diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-02-13 22:20:39 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-02-13 22:20:39 +0300 |
commit | e10e151e9b92313a7085272c85bebf6c82017fce (patch) | |
tree | 6cac4100536c5e25143c55d1ab6b2f3b3dc81cf9 /ext/gmp/gmp.c | |
parent | bc630ad6da0c6d7cf2d224dba8972499d5691c6b (diff) | |
download | php-git-e10e151e9b92313a7085272c85bebf6c82017fce.tar.gz |
Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
Diffstat (limited to 'ext/gmp/gmp.c')
-rw-r--r-- | ext/gmp/gmp.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 7d591e2383..a64da90745 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -433,8 +433,7 @@ static HashTable *gmp_get_debug_info(zval *obj, int *is_temp) /* {{{ */ zval zv; *is_temp = 1; - ALLOC_HASHTABLE(ht); - zend_array_dup(ht, props); + ht = zend_array_dup(props); gmp_strval(&zv, gmpnum, 10); zend_hash_str_update(ht, "num", sizeof("num")-1, &zv); @@ -560,7 +559,6 @@ static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len, smart_str buf = {0}; zval zv; php_serialize_data_t serialize_data = (php_serialize_data_t) data; - zend_array tmp_arr; PHP_VAR_SERIALIZE_INIT(serialize_data); @@ -568,8 +566,7 @@ static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len, php_var_serialize(&buf, &zv, &serialize_data); zval_dtor(&zv); - ZVAL_ARR(&zv, &tmp_arr); - tmp_arr.ht = *zend_std_get_properties(object); + ZVAL_ARR(&zv, zend_std_get_properties(object)); php_var_serialize(&buf, &zv, &serialize_data); PHP_VAR_SERIALIZE_DESTROY(serialize_data); |