Add GC support for ArrayObject · php/php-src@4e03ba4

@@ -831,6 +831,15 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp) /* {{{ */

831831

}

832832

/* }}} */

833833834+

static HashTable *spl_array_get_gc(zval *obj, zval **gc_data, int *gc_data_count) /* {{{ */

835+

{

836+

spl_array_object *intern = Z_SPLARRAY_P(obj);

837+

*gc_data = &intern->array;

838+

*gc_data_count = 1;

839+

return zend_std_get_properties(obj);

840+

}

841+

/* }}} */

842+834843

static zval *spl_array_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */

835844

{

836845

spl_array_object *intern = Z_SPLARRAY_P(object);

@@ -1913,6 +1922,7 @@ PHP_MINIT_FUNCTION(spl_array)

1913192219141923

spl_handler_ArrayObject.get_properties = spl_array_get_properties;

19151924

spl_handler_ArrayObject.get_debug_info = spl_array_get_debug_info;

1925+

spl_handler_ArrayObject.get_gc = spl_array_get_gc;

19161926

spl_handler_ArrayObject.read_property = spl_array_read_property;

19171927

spl_handler_ArrayObject.write_property = spl_array_write_property;

19181928

spl_handler_ArrayObject.get_property_ptr_ptr = spl_array_get_property_ptr_ptr;