com php-src: Order of classes may matter: ext/opcache/ZendAccelerator.c
| From: | Dmitry Stogov | Date: | Tue, 19 Feb 2019 20:50:17 +0000 |
| Subject: | com php-src: Order of classes may matter: ext/opcache/ZendAccelerator.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-104752@lists.php.net to get a copy of this message | ||
Commit: 6b0023897976b6fa8d1b1c5f90e25327d9000913
Author: Dmitry Stogov <dmitry@zend.com> Tue, 19 Feb 2019 23:50:17 +0300
Parents: 0510b41a0671fc1094a4e4521faaceb920889001
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6b0023897976b6fa8d1b1c5f90e25327d9000913
Log:
Order of classes may matter
Changed paths:
M ext/opcache/ZendAccelerator.c
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 4068459..06ccd11 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -4018,6 +4018,9 @@ static int accel_preload(const char *config)
i = 0;
ZCSG(saved_scripts) = zend_shared_alloc((zend_hash_num_elements(preload_scripts) + 1) *
sizeof(void*));
ZEND_HASH_FOREACH_PTR(preload_scripts, script) {
+ if (zend_hash_num_elements(&script->script.class_table) > 1) {
+ zend_hash_sort_ex(&script->script.class_table, preload_sort_classes, NULL, 0);
+ }
ZCSG(saved_scripts)[i++] = preload_script_in_shared_memory(script);
} ZEND_HASH_FOREACH_END();
ZCSG(saved_scripts)[i] = NULL;