diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-05-29 18:21:56 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-05-29 18:21:56 +0400 |
commit | b3b616cf7ee0702aca2f6fdb022dc7e28e015a22 (patch) | |
tree | 933686808b06b0408b0207f6fa2afe9111b866f9 /Zend/zend_variables.h | |
parent | bfff679d903c7ef1648d3d009f42566baa7d6232 (diff) | |
download | php-git-b3b616cf7ee0702aca2f6fdb022dc7e28e015a22.tar.gz |
Introduced immutable arrays. They don't need to be copyed and may be used directly from SHM.
Diffstat (limited to 'Zend/zend_variables.h')
-rw-r--r-- | Zend/zend_variables.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h index b85ef435ca..282725a325 100644 --- a/Zend/zend_variables.h +++ b/Zend/zend_variables.h @@ -42,8 +42,8 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC); static zend_always_inline void _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC) { - if (Z_REFCOUNTED_P(zvalue)) { - if (Z_COPYABLE_P(zvalue)) { + if (Z_REFCOUNTED_P(zvalue) || Z_IMMUTABLE_P(zvalue)) { + if (Z_COPYABLE_P(zvalue) || Z_IMMUTABLE_P(zvalue)) { _zval_copy_ctor_func(zvalue ZEND_FILE_LINE_RELAY_CC); } else { Z_ADDREF_P(zvalue); @@ -53,8 +53,8 @@ static zend_always_inline void _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC) static zend_always_inline void _zval_opt_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC) { - if (Z_OPT_REFCOUNTED_P(zvalue)) { - if (Z_OPT_COPYABLE_P(zvalue)) { + if (Z_OPT_REFCOUNTED_P(zvalue) || Z_OPT_IMMUTABLE_P(zvalue)) { + if (Z_OPT_COPYABLE_P(zvalue) || Z_OPT_IMMUTABLE_P(zvalue)) { _zval_copy_ctor_func(zvalue ZEND_FILE_LINE_RELAY_CC); } else { Z_ADDREF_P(zvalue); |