diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2012-12-05 17:58:36 +0400 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2012-12-05 17:58:36 +0400 |
| commit | df97c3aa0d331be668bd5d8f27fff96d4e3ac1d7 (patch) | |
| tree | a525e310a0d4001c6aad77dff1d5a6526284edea /ext/simplexml/simplexml.c | |
| parent | 881416cda670a7ddb94db11a41d4929425da7d61 (diff) | |
| download | php-git-df97c3aa0d331be668bd5d8f27fff96d4e3ac1d7.tar.gz | |
Use get_gc instead of hacks of get_properties
Diffstat (limited to 'ext/simplexml/simplexml.c')
| -rw-r--r-- | ext/simplexml/simplexml.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 5514f0fc89..b510786660 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1081,15 +1081,9 @@ static HashTable * sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{ 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 { - if (GC_G(gc_active)) { - return NULL; - } ALLOC_HASHTABLE(rv); zend_hash_init(rv, 0, NULL, ZVAL_PTR_DTOR, 0); sxe->properties = rv; @@ -1201,6 +1195,16 @@ next_iter: } /* }}} */ +static HashTable * sxe_get_gc(zval *object, zval ***table, int *n TSRMLS_DC) /* {{{ */ { + php_sxe_object *sxe; + sxe = php_sxe_fetch_object(object TSRMLS_CC); + + *table = NULL; + *n = 0; + return sxe->properties; +} +/* }}} */ + static HashTable * sxe_get_properties(zval *object TSRMLS_DC) /* {{{ */ { return sxe_get_prop_hash(object, 0 TSRMLS_CC); @@ -1966,7 +1970,9 @@ static zend_object_handlers sxe_object_handlers = { /* {{{ */ sxe_objects_compare, sxe_object_cast, sxe_count_elements, - sxe_get_debug_info + sxe_get_debug_info, + NULL, + sxe_get_gc }; /* }}} */ |
