]> granicus.if.org Git - php/commitdiff
Add free_estring()
authorZeev Suraski <zeev@php.net>
Mon, 15 Jan 2001 10:52:06 +0000 (10:52 +0000)
committerZeev Suraski <zeev@php.net>
Mon, 15 Jan 2001 10:52:06 +0000 (10:52 +0000)
Zend/zend.c
Zend/zend.h
Zend/zend_compile.c

index 8fbb1f5f1d67e546b532d1968b6c0c8cb073fa1d..3ba4b1ee9b982446168d9840d0ad1b32b0c75534 100644 (file)
@@ -782,3 +782,8 @@ ZEND_API char *zend_make_compiled_string_description(char *name)
        return compiled_string_description;
 }
 
+
+void free_estring(char **str_p)
+{
+       efree(*str_p);
+}
index f9017bf56110f4e5b96399b5d75dfd7ac38572e6..d1a5cd6fbb0c4baa0558970c0ab3cb670e5798b7 100644 (file)
@@ -309,6 +309,8 @@ ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ..
 
 ZEND_API extern char *empty_string;
 
+ZEND_API void free_estring(char **str_p);
+
 #define STR_FREE(ptr) if (ptr && ptr!=empty_string) { efree(ptr); }
 #define STR_FREE_REL(ptr) if (ptr && ptr!=empty_string) { efree_rel(ptr); }
 
index b1ee2bdc7abb3566d4100d3b0a3af873735fc540..0d790112718cb2ca62c87d7c98d7383fbeab0306 100644 (file)
@@ -34,11 +34,6 @@ ZEND_API zend_compiler_globals compiler_globals;
 ZEND_API zend_executor_globals executor_globals;
 #endif
 
-static void free_filename(void *p)
-{
-       efree(*((char **) p));
-}
-
 
 static void build_runtime_defined_function_key(zval *result, zval *name, zend_op *opline CLS_DC)
 {
@@ -80,7 +75,7 @@ void init_compiler(CLS_D ELS_DC)
        CG(active_class_entry) = NULL;
        zend_llist_init(&CG(list_llist), sizeof(list_llist_element), NULL, 0);
        zend_llist_init(&CG(dimension_llist), sizeof(int), NULL, 0);
-       zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_filename, 0);
+       zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_estring, 0);
        CG(handle_op_arrays) = 1;
        CG(in_compilation) = 0;
        zend_init_rsrc_list(ELS_C);