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 /ext/json | |
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 'ext/json')
-rw-r--r-- | ext/json/json.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/json/json.c b/ext/json/json.c index 7760741125..e7e07ce2c1 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -258,7 +258,7 @@ static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC) ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, data) { ZVAL_DEREF(data); tmp_ht = HASH_OF(data); - if (tmp_ht) { + if (tmp_ht && ZEND_HASH_APPLY_PROTECTION(tmp_ht)) { ZEND_HASH_INC_APPLY_COUNT(tmp_ht); } @@ -318,7 +318,7 @@ static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC) } } - if (tmp_ht) { + if (tmp_ht && ZEND_HASH_APPLY_PROTECTION(tmp_ht)) { ZEND_HASH_DEC_APPLY_COUNT(tmp_ht); } } ZEND_HASH_FOREACH_END(); |