Skip to content

Commit d51b9a6

Browse files
committed
Remove unnecessary destroy wrappers
There used to be needed due to ZEND_FILE_LINE in debug builds. As the argument is no longer passed, we don't need the wrappers either.
1 parent dfa166e commit d51b9a6

File tree

1 file changed

+4
-38
lines changed

1 file changed

+4
-38
lines changed

Zend/zend_variables.c

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@ static void ZEND_FASTCALL zend_string_destroy(zend_string *str);
3030
static void ZEND_FASTCALL zend_reference_destroy(zend_reference *ref);
3131
static void ZEND_FASTCALL zend_empty_destroy(zend_reference *ref);
3232

33-
#if ZEND_DEBUG
34-
static void ZEND_FASTCALL zend_array_destroy_wrapper(zend_array *arr);
35-
static void ZEND_FASTCALL zend_object_destroy_wrapper(zend_object *obj);
36-
static void ZEND_FASTCALL zend_resource_destroy_wrapper(zend_resource *res);
37-
static void ZEND_FASTCALL zend_ast_ref_destroy_wrapper(zend_ast_ref *ast);
38-
#else
39-
# define zend_array_destroy_wrapper zend_array_destroy
40-
# define zend_object_destroy_wrapper zend_objects_store_del
41-
# define zend_resource_destroy_wrapper zend_list_free
42-
# define zend_ast_ref_destroy_wrapper zend_ast_ref_destroy
43-
#endif
44-
4533
typedef void (ZEND_FASTCALL *zend_rc_dtor_func_t)(zend_refcounted *p);
4634

4735
static const zend_rc_dtor_func_t zend_rc_dtor_func[] = {
@@ -52,11 +40,11 @@ static const zend_rc_dtor_func_t zend_rc_dtor_func[] = {
5240
/* IS_LONG */ (zend_rc_dtor_func_t)zend_empty_destroy,
5341
/* IS_DOUBLE */ (zend_rc_dtor_func_t)zend_empty_destroy,
5442
/* IS_STRING */ (zend_rc_dtor_func_t)zend_string_destroy,
55-
/* IS_ARRAY */ (zend_rc_dtor_func_t)zend_array_destroy_wrapper,
56-
/* IS_OBJECT */ (zend_rc_dtor_func_t)zend_object_destroy_wrapper,
57-
/* IS_RESOURCE */ (zend_rc_dtor_func_t)zend_resource_destroy_wrapper,
43+
/* IS_ARRAY */ (zend_rc_dtor_func_t)zend_array_destroy,
44+
/* IS_OBJECT */ (zend_rc_dtor_func_t)zend_objects_store_del,
45+
/* IS_RESOURCE */ (zend_rc_dtor_func_t)zend_list_free,
5846
/* IS_REFERENCE */ (zend_rc_dtor_func_t)zend_reference_destroy,
59-
/* IS_CONSTANT_AST */ (zend_rc_dtor_func_t)zend_ast_ref_destroy_wrapper
47+
/* IS_CONSTANT_AST */ (zend_rc_dtor_func_t)zend_ast_ref_destroy
6048
};
6149

6250
ZEND_API void ZEND_FASTCALL rc_dtor_func(zend_refcounted *p)
@@ -84,28 +72,6 @@ static void ZEND_FASTCALL zend_empty_destroy(zend_reference *ref)
8472
{
8573
}
8674

87-
#if ZEND_DEBUG
88-
static void ZEND_FASTCALL zend_array_destroy_wrapper(zend_array *arr)
89-
{
90-
zend_array_destroy(arr);
91-
}
92-
93-
static void ZEND_FASTCALL zend_object_destroy_wrapper(zend_object *obj)
94-
{
95-
zend_objects_store_del(obj);
96-
}
97-
98-
static void ZEND_FASTCALL zend_resource_destroy_wrapper(zend_resource *res)
99-
{
100-
zend_list_free(res);
101-
}
102-
103-
static void ZEND_FASTCALL zend_ast_ref_destroy_wrapper(zend_ast_ref *ast)
104-
{
105-
zend_ast_ref_destroy(ast);
106-
}
107-
#endif
108-
10975
ZEND_API void zval_ptr_dtor(zval *zval_ptr) /* {{{ */
11076
{
11177
i_zval_ptr_dtor(zval_ptr);

0 commit comments

Comments
 (0)