From 0a21a0c752a06d25704e04c15464700f75164849 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 15 Jun 2015 13:18:52 +0300 Subject: [PATCH] Removed opcache.load_comments configuration directive. Now doc comments loading costs nothing and always enabled. --- NEWS | 4 ++++ UPGRADING | 4 ++++ ext/opcache/README | 5 ----- ext/opcache/ZendAccelerator.h | 1 - ext/opcache/zend_accelerator_module.c | 2 -- ext/opcache/zend_accelerator_util_funcs.c | 21 ++------------------- 6 files changed, 10 insertions(+), 27 deletions(-) diff --git a/NEWS b/NEWS index 538c38b4af3ef..e0f2a16804fab 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 c21e197655b2e..75b6c30f6d131 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 ef656ae579379..c07444013071e 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 2c6584a1e2a28..6ce4613d2f242 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 7a8ef8d3e8aa9..531ea6e9edb48 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 9582b723a2b87..996deecbb2ec2 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);