summaryrefslogtreecommitdiff
path: root/ext/spl/spl_array.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2015-04-16 10:07:41 +0200
committerNikita Popov <nikic@php.net>2015-05-20 18:28:09 +0200
commit4e03ba4a6ef4c16b53e49e32eb4992a797ae08a8 (patch)
tree3d96df6365634e2c87b0945175a7ad65a08004de /ext/spl/spl_array.c
parent4ea1d8a9c7f7a2292db720e61799656511df2c61 (diff)
downloadphp-git-4e03ba4a6ef4c16b53e49e32eb4992a797ae08a8.tar.gz
Add GC support for ArrayObject
gc_024 test changes because the array that ArrayObject holds is now counted separately from the ArrayObject.
Diffstat (limited to 'ext/spl/spl_array.c')
-rw-r--r--ext/spl/spl_array.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index c56e2d5f22..4ade06a5d8 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -831,6 +831,15 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp) /* {{{ */
}
/* }}} */
+static HashTable *spl_array_get_gc(zval *obj, zval **gc_data, int *gc_data_count) /* {{{ */
+{
+ spl_array_object *intern = Z_SPLARRAY_P(obj);
+ *gc_data = &intern->array;
+ *gc_data_count = 1;
+ return zend_std_get_properties(obj);
+}
+/* }}} */
+
static zval *spl_array_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
@@ -1913,6 +1922,7 @@ PHP_MINIT_FUNCTION(spl_array)
spl_handler_ArrayObject.get_properties = spl_array_get_properties;
spl_handler_ArrayObject.get_debug_info = spl_array_get_debug_info;
+ spl_handler_ArrayObject.get_gc = spl_array_get_gc;
spl_handler_ArrayObject.read_property = spl_array_read_property;
spl_handler_ArrayObject.write_property = spl_array_write_property;
spl_handler_ArrayObject.get_property_ptr_ptr = spl_array_get_property_ptr_ptr;