com php-src: Fixed GC problem (arrays may be recorded as possible root of garbage cycle. we have to clear this info before deleting array):
ext/opcache/zend_persist.c
| From: | Dmitry Stogov | Date: | Mon, 08 Sep 2014 20:12:36 +0000 |
| Subject: | com php-src: Fixed GC problem (arrays may be recorded as possible root of garbage cycle. we have to clear this info before deleting array): ext/opcache/zend_persist.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81460@lists.php.net to get a copy of this message | ||
Commit: c59300ac86dd02bcdacd6c1460a5b43e91a5bf49
Author: Dmitry Stogov <dmitry@zend.com> Tue, 9 Sep 2014 00:12:36 +0400
Parents: d91717f458d5d3fd0e5d7278c2a6d16e7b4d52e6
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c59300ac86dd02bcdacd6c1460a5b43e91a5bf49
Log:
Fixed GC problem (arrays may be recorded as possible root of garbage cycle. we have to clear this
info before deleting array)
Changed paths:
M ext/opcache/zend_persist.c
Diff:
diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c
index b49f28f..b34e905 100644
--- a/ext/opcache/zend_persist.c
+++ b/ext/opcache/zend_persist.c
@@ -198,6 +198,9 @@ static void zend_persist_zval(zval *z TSRMLS_DC)
Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array));
zend_hash_persist_immutable(Z_ARRVAL_P(z) TSRMLS_CC);
} else {
+ if (!zend_shared_alloc_get_xlat_entry(Z_ARR_P(z))) {
+ GC_REMOVE_FROM_BUFFER(Z_ARR_P(z));
+ }
zend_accel_store(Z_ARR_P(z), sizeof(zend_array));
zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval TSRMLS_CC);
/* make immutable array */
@@ -251,6 +254,9 @@ static void zend_persist_zval_const(zval *z TSRMLS_DC)
Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array));
zend_hash_persist_immutable(Z_ARRVAL_P(z) TSRMLS_CC);
} else {
+ if (!zend_shared_alloc_get_xlat_entry(Z_ARR_P(z))) {
+ GC_REMOVE_FROM_BUFFER(Z_ARR_P(z));
+ }
zend_accel_store(Z_ARR_P(z), sizeof(zend_array));
zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval TSRMLS_CC);
/* make immutable array */