diff options
author | Dmitry Stogov <dmitry@zend.com> | 2017-11-30 16:23:15 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2017-11-30 16:23:15 +0300 |
commit | e221e7379ed34d33521dab1e3e6a93948df84aed (patch) | |
tree | 604c3948a31ab7b8bc6990809af97d66c630fe03 | |
parent | 245422653c97cd1fb6bcd6de725574b37b4b639b (diff) | |
download | php-git-e221e7379ed34d33521dab1e3e6a93948df84aed.tar.gz |
Avoid function duplication
-rw-r--r-- | ext/opcache/ZendAccelerator.c | 7 | ||||
-rw-r--r-- | ext/opcache/zend_accelerator_util_funcs.c | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 559322b088..2a50b59eed 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2499,15 +2499,10 @@ static void accel_globals_ctor(zend_accel_globals *accel_globals) accel_gen_system_id(); } -static void accel_globals_internal_func_dtor(zval *zv) -{ - free(Z_PTR_P(zv)); -} - static void accel_globals_dtor(zend_accel_globals *accel_globals) { if (accel_globals->function_table.nTableSize) { - accel_globals->function_table.pDestructor = accel_globals_internal_func_dtor; + accel_globals->function_table.pDestructor = NULL; zend_hash_destroy(&accel_globals->function_table); } } diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index f2ac334e47..b914d23463 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -143,7 +143,7 @@ void zend_accel_copy_internal_functions(void) ZEND_HASH_FOREACH_STR_KEY_VAL(CG(function_table), key, val) { zend_internal_function *function = Z_PTR_P(val); if (function->type == ZEND_INTERNAL_FUNCTION) { - zend_hash_update_mem(&ZCG(function_table), key, function, sizeof(zend_internal_function)); + zend_hash_add_new_ptr(&ZCG(function_table), key, function); } } ZEND_HASH_FOREACH_END(); ZCG(internal_functions_count) = zend_hash_num_elements(&ZCG(function_table)); |