com php-src: Removed opcache.load_comments configuration directive. Now doc comments loading costs noth ing and always enabled.: NEWS UPGRADING
ext/opc ache/README ext/opcache/ZendAccelerator.h ext/opcache/zen d_accelerator_module.c ext/opcache/zend_accelerator _util_funcs.c
| From: | Dmitry Stogov | Date: | Mon, 15 Jun 2015 10:18:52 +0000 |
| Subject: | com php-src: Removed opcache.load_comments configuration directive. Now doc comments loading costs noth ing and always enabled.: NEWS UPGRADING ext/opc ache/README ext/opcache/ZendAccelerator.h ext/opcache/zen d_accelerator_module.c ext/opcache/zend_accelerator _util_funcs.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87275@lists.php.net to get a copy of this message | ||
Commit: 0a21a0c752a06d25704e04c15464700f75164849
Author: Dmitry Stogov <dmitry@zend.com> Mon, 15 Jun 2015 13:18:52 +0300
Parents: 7eae1cc2ce27469aa6f779203792ca447d765e66
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0a21a0c752a06d25704e04c15464700f75164849
Log:
Removed opcache.load_comments configuration directive. Now doc comments loading costs nothing and
always enabled.
Changed paths:
M NEWS
M UPGRADING
M ext/opcache/README
M ext/opcache/ZendAccelerator.h
M ext/opcache/zend_accelerator_module.c
M ext/opcache/zend_accelerator_util_funcs.c
Diff:
diff --git a/NEWS b/NEWS
index 538c38b..e0f2a16 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,10 @@ PHP NEWS
. Fixed bug #69831 (Segmentation fault in curl_getinfo). (im dot denisenko at
yahoo dot com)
+- Opcache:
+ . Removed opcache.load_comments configuration directive. Now doc comments
+ loading costs nothing and always enabled. (Dmitry)
+
- PDO_pgsql:
. Fixed bug #69752 (PDOStatement::execute() leaks memory with DML
Statements when closeCuror() is u). (Philip Hofstetter)
diff --git a/UPGRADING b/UPGRADING
index c21e197..75b6c30 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -484,6 +484,10 @@ Other
. session.lazy_write(default=On) INI setting enables only write session data when
session data is updated.
+- Opcache
+ . Removed opcache.load_comments configuration directive. Now doc comments
+ loading costs nothing and always enabled.
+
- OpenSSL:
. Removed the "rsa_key_size" SSL context option in favor of automatically
setting the appropriate size given the negotiated crypto algorithm.
diff --git a/ext/opcache/README b/ext/opcache/README
index ef656ae..c074440 100644
--- a/ext/opcache/README
+++ b/ext/opcache/README
@@ -127,11 +127,6 @@ opcache.save_comments (default "1")
size of the optimized code. Disabling "Doc Comments" may break some
existing applications and frameworks (e.g. Doctrine, ZF2, PHPUnit)
-opcache.load_comments (default "1")
- If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
- may be always stored (save_comments=1), but not loaded by applications
- that don't need them anyway.
-
opcache.fast_shutdown (default "0")
If enabled, a fast shutdown sequence is used for the accelerated code
The fast shutdown sequence doesn't free each allocated block, but lets
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index 2c6584a..6ce4613 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -196,7 +196,6 @@ typedef struct _zend_accel_directives {
zend_bool validate_timestamps;
zend_bool revalidate_path;
zend_bool save_comments;
- zend_bool load_comments;
zend_bool fast_shutdown;
zend_bool protect_memory;
zend_bool file_override_enabled;
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index 7a8ef8d..531ea6e 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -292,7 +292,6 @@ ZEND_INI_BEGIN()
STD_PHP_INI_ENTRY("opcache.protect_memory" , "0" , PHP_INI_SYSTEM,
OnUpdateBool, accel_directives..protect_memory, zend_accel_globals,
accel_globals)
STD_PHP_INI_ENTRY("opcache.save_comments" , "1" , PHP_INI_SYSTEM,
OnUpdateBool, accel_directives.save_comments, zend_accel_globals,
accel_globals)
- STD_PHP_INI_ENTRY("opcache.load_comments" , "1" , PHP_INI_ALL,
OnUpdateBool, accel_directives.load_comments, zend_accel_globals,
accel_globals)
STD_PHP_INI_ENTRY("opcache.fast_shutdown" , "0" , PHP_INI_SYSTEM,
OnUpdateBool, accel_directives.fast_shutdown, zend_accel_globals,
accel_globals)
STD_PHP_INI_ENTRY("opcache.optimization_level" , DEFAULT_OPTIMIZATION_LEVEL ,
PHP_INI_SYSTEM, OnUpdateLong, accel_directives.optimization_level, zend_accel_globals,
accel_globals)
@@ -695,7 +694,6 @@ static ZEND_FUNCTION(opcache_get_configuration)
add_assoc_bool(&directives, "opcache.protect_memory",
ZCG(accel_directives).protect_memory);
add_assoc_bool(&directives, "opcache.save_comments",
ZCG(accel_directives).save_comments);
- add_assoc_bool(&directives, "opcache.load_comments",
ZCG(accel_directives).load_comments);
add_assoc_bool(&directives, "opcache.fast_shutdown",
ZCG(accel_directives).fast_shutdown);
add_assoc_bool(&directives, "opcache.enable_file_override",
ZCG(accel_directives).file_override_enabled);
add_assoc_long(&directives, "opcache.optimization_level",
ZCG(accel_directives).optimization_level);
diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c
index 9582b72..996deec 100644
--- a/ext/opcache/zend_accelerator_util_funcs.c
+++ b/ext/opcache/zend_accelerator_util_funcs.c
@@ -373,18 +373,8 @@ static void zend_hash_clone_prop_info(HashTable *ht, HashTable *source,
zend_cla
prop_info = ARENA_REALLOC(Z_PTR(p->val));
ZVAL_PTR(&q->val, prop_info);
- if (prop_info->ce == old_ce || (prop_info->flags & ZEND_ACC_SHADOW)) {
- /* Copy constructor */
- if (prop_info->doc_comment) {
- if (ZCG(accel_directives).load_comments) {
- prop_info->doc_comment = zend_string_dup(prop_info->doc_comment, 0);
- } else {
- prop_info->doc_comment = NULL;
- }
- }
- prop_info->ce = ARENA_REALLOC(prop_info->ce);
- } else if ((void*)prop_info->ce >= ZCG(current_persistent_script)->arena_mem &&
- (void*)prop_info->ce <
(void*)((char*)ZCG(current_persistent_script)->arena_mem +
ZCG(current_persistent_script)->arena_size)) {
+ if ((void*)prop_info->ce >= ZCG(current_persistent_script)->arena_mem &&
+ (void*)prop_info->ce < (void*)((char*)ZCG(current_persistent_script)->arena_mem +
ZCG(current_persistent_script)->arena_size)) {
prop_info->ce = ARENA_REALLOC(prop_info->ce);
}
}
@@ -447,13 +437,6 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
} else {
ce->interfaces = NULL;
}
- if (ZEND_CE_DOC_COMMENT(ce)) {
- if (ZCG(accel_directives).load_comments) {
- ZEND_CE_DOC_COMMENT(ce) = zend_string_dup(ZEND_CE_DOC_COMMENT(ce), 0);
- } else {
- ZEND_CE_DOC_COMMENT(ce) = NULL;
- }
- }
if (ce->parent) {
ce->parent = ARENA_REALLOC(ce->parent);