Skip to content

Instantly share code, notes, and snippets.

🐒
Lexi is the love of my life, I love her more than she loves me

Sean DuBois Sean-Der

🐒
Lexi is the love of my life, I love her more than she loves me
Block or report user

Report or block Sean-Der

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:b652fb9299ea8dc405c2
Thanks everyone for all the tips on getting this running! I am currently running it on OSX 10.9.5 using Wineskin Winery, and have music+fullscreen and everything seems to be working! I built a [url=http://wineskin.urgesoftware.com/tiki-index.php?page=Manual+2.4+Making+a+Custom+Engine]custom engine[/url] and applied the patch listed before
A quick overview, open a terminal and do the following
[i]Grab wine from git[/i]
git://source.winehq.org/git/wine.git
[i]Apply the patch[/i]
cd wine && curl "https://bugs.winehq.org/attachment.cgi?id=50611&action=diff&context=patch&collapsed=&headers=1&format=raw" | git apply
View gist:455a329c6c5b6d4f112e
require "formula"
class Squashfs < Formula
homepage "http://squashfs.sourceforge.net/"
url "https://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.3/squashfs4.3.tar.gz"
sha256 "0d605512437b1eb800b4736791559295ee5f60177e102e4d4ccd0ee241a5f3f6"
bottle do
cellar :any
sha1 "ea27e099828f9809190115e4eb874894d5234c9f" => :mavericks
View gist:5cd42ee123336264332b
When unpacking we currently use one zval *
https://github.com/msgpack/msgpack-php/blob/master/msgpack/unpack_template.h#L119
This worked great when we change that pointer's value, and malloc a zval
https://github.com/msgpack/msgpack-php/blob/master/msgpack_unpack.c#L31
https://github.com/msgpack/msgpack-php/blob/master/msgpack_unpack.c#L40
However, now the zend-api expects to use stack allocated zvals right? I
don't want to edit unpack_template.h, but I don't see an easy way to
reallocate for every object (something like alloca) I can create one
View gist:17d77699f6ffcffd3988
(gdb) print_ht ht
Packed(2)[0x16fb990]: {
[0] 0 => [0x16d95a8] (refcount=3) reference: [0x16fb9d8] (refcount=1) array:
[1] 1 => [0x16d95c8] (refcount=3) reference: [0x16fb9d8] (refcount=1) array:
}
View gist:1be1c8b998d95ef51bee
//PHP 5 Code
zval *foobar, *foobar2;
ALLOC_INIT_ZVAL(foobar)
ALLOC_INIT_ZVAL(foobar2)
array_init(foobar);
array_init(foobar2);
Z_SET_ISREF_P(foobar);
View gist:680b22360523a01925fb
//PHP 7
array(1) {
[0]=>
array(0) {
}
}
array(1) refcount(2){
[0]=>
array(0) refcount(1){
}
View gist:2a7617bc2d98ce84ccfe
PRE
array(1) refcount(1){
[0]=>
&array(1) refcount(3){
[0]=>
&array(1) refcount(2){
[0]=>
&array(1) refcount(3){
[0]=>
&array(1) refcount(2){
View gist:cd94c0b6fb71a81e089b
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 0
Exts tested : 54
---------------------------------------------------------------------
Number of tests : 195 118
Tests skipped : 77 ( 39.5%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 17 ( 8.7%) ( 14.4%)
View gist:f8cb8578f195dc563414
static ZEND_FUNCTION(msgpack_unserialize){
zval *object, *bool_val, *ref_val;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &object) == FAILURE) {
return;
}
ALLOC_INIT_ZVAL(bool_val);
ZVAL_BOOL(bool_val, true);
ALLOC_INIT_ZVAL(ref_val);
View gist:4a07a044dab4dd23e46b
static ZEND_FUNCTION(msgpack_unserialize)
{
zval *object, ref_val;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &object) == FAILURE) {
return;
}
array_init(&ref_val);
ZVAL_MAKE_REF(&ref_val);
Z_TRY_ADDREF_P(&ref_val);
You can’t perform that action at this time.