diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-06-05 16:04:11 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-06-05 16:04:11 +0400 |
commit | c1965f58d4dd3970912dcd6a63ccd5860bae1a97 (patch) | |
tree | 15b4a94e8e8405f791438c468ad4eb03f60c4079 /ext/spl/spl_fixedarray.c | |
parent | 3d87391cc06fe87344536e88ac74ded22b0195cf (diff) | |
download | php-git-c1965f58d4dd3970912dcd6a63ccd5860bae1a97.tar.gz |
Use reference counting instead of zval duplication
Diffstat (limited to 'ext/spl/spl_fixedarray.c')
-rw-r--r-- | ext/spl/spl_fixedarray.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index f9f89dfd9c..62aaffbc3c 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -405,8 +405,8 @@ static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_o if (!Z_ISUNDEF(intern->array->elements[index])) { zval_ptr_dtor(&(intern->array->elements[index])); } - SEPARATE_ARG_IF_REF(value); - ZVAL_COPY_VALUE(&intern->array->elements[index], value); + ZVAL_DEREF(value); + ZVAL_COPY(&intern->array->elements[index], value); } } /* }}} */ @@ -708,8 +708,8 @@ SPL_METHOD(SplFixedArray, fromArray) spl_fixedarray_init(array, tmp TSRMLS_CC); ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), num_index, str_index, element) { - SEPARATE_ARG_IF_REF(element); - ZVAL_COPY_VALUE(&array->elements[num_index], element); + ZVAL_DEREF(element); + ZVAL_COPY(&array->elements[num_index], element); } ZEND_HASH_FOREACH_END(); } else if (num > 0 && !save_indexes) { @@ -719,8 +719,8 @@ SPL_METHOD(SplFixedArray, fromArray) spl_fixedarray_init(array, num TSRMLS_CC); ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(data), element) { - SEPARATE_ARG_IF_REF(element); - ZVAL_COPY_VALUE(&array->elements[i], element); + ZVAL_DEREF(element); + ZVAL_COPY(&array->elements[i], element); i++; } ZEND_HASH_FOREACH_END(); } else { |