Skip to content

Commit

Permalink
Removed opcache.load_comments configuration directive. Now doc commen…
Browse files Browse the repository at this point in the history
…ts loading costs nothing and always enabled.
  • Loading branch information
dstogov committed Jun 15, 2015
1 parent 7eae1cc commit 0a21a0c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 27 deletions.
4 changes: 4 additions & 0 deletions NEWS
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions UPGRADING
Expand Up @@ -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.
Expand Down
5 changes: 0 additions & 5 deletions ext/opcache/README
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion ext/opcache/ZendAccelerator.h
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions ext/opcache/zend_accelerator_module.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
21 changes: 2 additions & 19 deletions ext/opcache/zend_accelerator_util_funcs.c
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
Expand Down

3 comments on commit 0a21a0c

@Sobak
Copy link
Contributor

@Sobak Sobak commented on 0a21a0c Jun 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this directive should be removed from php.ini files, as well.

@dstogov
Copy link
Member Author

@dstogov dstogov commented on 0a21a0c Jun 15, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sobak
Copy link
Contributor

@Sobak Sobak commented on 0a21a0c Jun 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Please sign in to comment.