Skip to content

Commit e221e73

Browse files
committed
Avoid function duplication
1 parent 2454226 commit e221e73

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,15 +2499,10 @@ static void accel_globals_ctor(zend_accel_globals *accel_globals)
24992499
accel_gen_system_id();
25002500
}
25012501

2502-
static void accel_globals_internal_func_dtor(zval *zv)
2503-
{
2504-
free(Z_PTR_P(zv));
2505-
}
2506-
25072502
static void accel_globals_dtor(zend_accel_globals *accel_globals)
25082503
{
25092504
if (accel_globals->function_table.nTableSize) {
2510-
accel_globals->function_table.pDestructor = accel_globals_internal_func_dtor;
2505+
accel_globals->function_table.pDestructor = NULL;
25112506
zend_hash_destroy(&accel_globals->function_table);
25122507
}
25132508
}

ext/opcache/zend_accelerator_util_funcs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void zend_accel_copy_internal_functions(void)
143143
ZEND_HASH_FOREACH_STR_KEY_VAL(CG(function_table), key, val) {
144144
zend_internal_function *function = Z_PTR_P(val);
145145
if (function->type == ZEND_INTERNAL_FUNCTION) {
146-
zend_hash_update_mem(&ZCG(function_table), key, function, sizeof(zend_internal_function));
146+
zend_hash_add_new_ptr(&ZCG(function_table), key, function);
147147
}
148148
} ZEND_HASH_FOREACH_END();
149149
ZCG(internal_functions_count) = zend_hash_num_elements(&ZCG(function_table));

0 commit comments

Comments
 (0)