From 81d901b14dd87285977ba7947a0268adb6519089 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Fri, 9 Jul 1999 17:24:47 +0000 Subject: Step 1 in nuking the garbage collector: - Change the hash destructor to return int - Don't kill the bucket on hash_destroy if the destructor returns 0 --- Zend/zend_opcode.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Zend/zend_opcode.c') diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 96ff8687dc..ba351af1a7 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -99,7 +99,7 @@ void init_op_array(zend_op_array *op_array, int initial_ops_size) } -ZEND_API void destroy_zend_function(zend_function *function) +ZEND_API int destroy_zend_function(zend_function *function) { switch (function->type) { case ZEND_USER_FUNCTION: @@ -109,13 +109,14 @@ ZEND_API void destroy_zend_function(zend_function *function) /* do nothing */ break; } + return 1; } -ZEND_API void destroy_zend_class(zend_class_entry *ce) +ZEND_API int destroy_zend_class(zend_class_entry *ce) { if (--(*ce->refcount)>0) { - return; + return 1; } switch (ce->type) { case ZEND_USER_CLASS: @@ -131,6 +132,7 @@ ZEND_API void destroy_zend_class(zend_class_entry *ce) zend_hash_destroy(&ce->default_properties); break; } + return 1; } -- cgit v1.2.1