Skip to content

Instantly share code, notes, and snippets.

View Sean-Der's full-sized avatar
🙈
Lexi is the love of my life, I love her more then Daisy loves cheese

Sean DuBois Sean-Der

🙈
Lexi is the love of my life, I love her more then Daisy loves cheese
View GitHub Profile
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
@Sean-Der
Sean-Der / gist:455a329c6c5b6d4f112e
Created February 17, 2015 06:25
Homebrew Forumla for squashfs 4.3 with patch http://sourceforge.net/p/squashfs/patches/20/
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
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
(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:
}
//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);
//PHP 7
array(1) {
[0]=>
array(0) {
}
}
array(1) refcount(2){
[0]=>
array(0) refcount(1){
}
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){
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%)
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);
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);