com php-src: Avoid function duplication: ext/opcache/ZendAccelerator.c ext/opcache/zend_accelerator_util_funcs.c
| From: | Dmitry Stogov | Date: | Thu, 30 Nov 2017 13:23:15 +0000 |
| Subject: | com php-src: Avoid function duplication: ext/opcache/ZendAccelerator.c ext/opcache/zend_accelerator_util_funcs.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100455@lists.php.net to get a copy of this message | ||
Commit: e221e7379ed34d33521dab1e3e6a93948df84aed
Author: Dmitry Stogov <dmitry@zend.com> Thu, 30 Nov 2017 16:23:15 +0300
Parents: 245422653c97cd1fb6bcd6de725574b37b4b639b
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e221e7379ed34d33521dab1e3e6a93948df84aed
Log:
Avoid function duplication
Changed paths:
M ext/opcache/ZendAccelerator.c
M ext/opcache/zend_accelerator_util_funcs.c
Diff:
diff --git a/ext/opcache/ZendAccelerator..c b/ext/opcache/ZendAccelerator.c
index 559322b..2a50b59 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 f2ac334..b914d23 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));