summaryrefslogtreecommitdiff
path: root/Zend/zend.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-07-09 17:24:47 +0000
committerZeev Suraski <zeev@php.net>1999-07-09 17:24:47 +0000
commit81d901b14dd87285977ba7947a0268adb6519089 (patch)
treea94bc7f17920fd62d2de5fccd984bfba388d5475 /Zend/zend.c
parentdb1e0bc8201a1f6667094205dc14b3af248ddbd1 (diff)
downloadphp-git-81d901b14dd87285977ba7947a0268adb6519089.tar.gz
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
Diffstat (limited to 'Zend/zend.c')
-rw-r--r--Zend/zend.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index 5f4ba6e16c..9c2b23b31f 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -203,7 +203,7 @@ static void register_standard_class()
zend_standard_class_def.name = zend_strndup("stdClass", zend_standard_class_def.name_length);
zend_standard_class_def.parent = NULL;
zend_hash_init(&zend_standard_class_def.default_properties, 0, NULL, PVAL_PTR_DTOR, 1);
- zend_hash_init(&zend_standard_class_def.function_table, 0, NULL, (void (*)(void *)) destroy_zend_function, 1);
+ zend_hash_init(&zend_standard_class_def.function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1);
zend_standard_class_def.handle_function_call = NULL;
zend_standard_class_def.handle_property_get = NULL;
zend_standard_class_def.handle_property_set = NULL;
@@ -220,11 +220,11 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals)
zend_class_entry tmp_class;
compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable));
- zend_hash_init(compiler_globals->function_table, 100, NULL, (void (*)(void *)) destroy_zend_function, 1);
+ zend_hash_init(compiler_globals->function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1);
zend_hash_copy(compiler_globals->function_table, global_function_table, NULL, &tmp_func, sizeof(zend_function));
compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
- zend_hash_init(compiler_globals->class_table, 10, NULL, (void (*)(void *)) destroy_zend_class, 1);
+ zend_hash_init(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1);
zend_hash_copy(compiler_globals->class_table, global_class_table, zend_class_add_ref, &tmp_class, sizeof(zend_class_entry));
}
@@ -303,10 +303,10 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions)
#endif
GLOBAL_FUNCTION_TABLE = (HashTable *) malloc(sizeof(HashTable));
GLOBAL_CLASS_TABLE = (HashTable *) malloc(sizeof(HashTable));
- zend_hash_init(GLOBAL_FUNCTION_TABLE, 100, NULL, (void (*)(void *)) destroy_zend_function, 1);
- zend_hash_init(GLOBAL_CLASS_TABLE, 10, NULL, (void (*)(void *)) destroy_zend_class, 1);
+ zend_hash_init(GLOBAL_FUNCTION_TABLE, 100, NULL, ZEND_FUNCTION_DTOR, 1);
+ zend_hash_init(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1);
register_standard_class();
- zend_hash_init(&module_registry, 50, NULL, (void (*)(void *)) module_destructor, 1);
+ zend_hash_init(&module_registry, 50, NULL, ZEND_MODULE_DTOR, 1);
zend_hash_init(&list_destructors, 50, NULL, NULL, 1);
#ifdef ZTS