com php-src: Moved ZCG(function_table) back into ac cel_acrivate. It should be unique per thread. : ext/opcache/ZendAccelerator.c
| From: | Dmitry Stogov | Date: | Wed, 18 Oct 2017 15:26:30 +0000 |
| Subject: | com php-src: Moved ZCG(function_table) back into ac cel_acrivate. It should be unique per thread. : ext/opcache/ZendAccelerator.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99788@lists.php.net to get a copy of this message | ||
Commit: e87e62cc6f9dc490c1738fe9af5bb9bde995fcec
Author: Dmitry Stogov <dmitry@zend.com> Wed, 18 Oct 2017 18:26:30 +0300
Parents: b4903aef16ec215f2095ff0a3615524656401660
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e87e62cc6f9dc490c1738fe9af5bb9bde995fcec
Log:
Moved ZCG(function_table) back into accel_acrivate. It should be unique per thread.
Changed paths:
M ext/opcache/ZendAccelerator.c
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 400db34..cf1e1ce 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2140,6 +2140,11 @@ static void accel_activate(void)
return;
}
+ if (!ZCG(function_table).nTableSize) {
+ zend_hash_init(&ZCG(function_table), zend_hash_num_elements(CG(function_table)), NULL,
ZEND_FUNCTION_DTOR, 1);
+ zend_accel_copy_internal_functions();
+ }
+
/* PHP-5.4 and above return "double", but we use 1 sec precision */
ZCG(auto_globals_mask) = 0;
ZCG(request_time) = (time_t)sapi_get_request_time();
@@ -2628,9 +2633,6 @@ static int accel_post_startup(void)
}
}
- zend_hash_init(&ZCG(function_table), zend_hash_num_elements(CG(function_table)), NULL,
ZEND_FUNCTION_DTOR, 1);
- zend_accel_copy_internal_functions();
-
/********************************************/
/* End of non-SHM dependent initializations */
/********************************************/