Browse Source

Add free_estring()

PHP-4.0.5
Zeev Suraski 25 years ago
parent
commit
0e08845eb0
  1. 5
      Zend/zend.c
  2. 2
      Zend/zend.h
  3. 7
      Zend/zend_compile.c

5
Zend/zend.c

@ -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);
}

2
Zend/zend.h

@ -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); }

7
Zend/zend_compile.c

@ -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);

Loading…
Cancel
Save