Re: cvs: php-src(PHP_5_3) /ext/simplexml simplexml.c ZendEngine2 zend_gc.c zend_gc.h ZendEngine2/tests bug43918.phpt
| From: | Dmitry Stogov | Date: | Tue, 29 Jan 2008 13:38:07 +0000 |
| Subject: | Re: cvs: php-src(PHP_5_3) /ext/simplexml simplexml.c ZendEngine2 zend_gc.c zend_gc.h ZendEngine2/tests bug43918.phpt | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-48104@lists.php.net to get a copy of this message | ||
The fix affects get_properties() callback only in the moments when GC is in progress (not when GC is enabled).
The SimpleXML extensions already makes a trick keeping and reusing "fictive" properties HashTable, so I've extend it to support GC.
Thanks. Dmitry.
Marcus Boerger wrote:
Hello Dmitry, Tuesday, January 29, 2008, 10:59:42 AM, you wrote: [...]http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.35.2.8&r2=1.151.2.22.2.35.2.9&diff_format=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.8 php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.9Excuse my ignorance to the GC stuff :-) but this change results in a very big change of behavior, so how is this a fix? Best regards, Marcus--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.8 Wed Jan 23 09:52:57 2008+++ php-src/ext/simplexml/simplexml.c Tue Jan 29 09:59:42 2008 @@ -1081,6 +1081,9 @@zend_hash_init(rv, 0, NULL, ZVAL_PTR_DTOR, 0); } else if (sxe->properties) { + if (GC_G(gc_active)) { + return sxe->properties; + } zend_hash_clean(sxe->properties); rv = sxe->properties; } else {