summaryrefslogtreecommitdiff
path: root/ext/spl/spl_heap.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-06-05 16:04:11 +0400
committerDmitry Stogov <dmitry@zend.com>2014-06-05 16:04:11 +0400
commitc1965f58d4dd3970912dcd6a63ccd5860bae1a97 (patch)
tree15b4a94e8e8405f791438c468ad4eb03f60c4079 /ext/spl/spl_heap.c
parent3d87391cc06fe87344536e88ac74ded22b0195cf (diff)
downloadphp-git-c1965f58d4dd3970912dcd6a63ccd5860bae1a97.tar.gz
Use reference counting instead of zval duplication
Diffstat (limited to 'ext/spl/spl_heap.c')
-rw-r--r--ext/spl/spl_heap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index 52b4371f57..90d78db6ee 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -616,7 +616,7 @@ SPL_METHOD(SplHeap, insert)
return;
}
- SEPARATE_ARG_IF_REF(value);
+ if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
spl_ptr_heap_insert(intern->heap, value, getThis() TSRMLS_CC);
RETURN_TRUE;
@@ -670,8 +670,8 @@ SPL_METHOD(SplPriorityQueue, insert)
return;
}
- SEPARATE_ARG_IF_REF(data);
- SEPARATE_ARG_IF_REF(priority);
+ if (Z_REFCOUNTED_P(data)) Z_ADDREF_P(data);
+ if (Z_REFCOUNTED_P(priority)) Z_ADDREF_P(priority);
array_init(&elem);
add_assoc_zval_ex(&elem, "data", sizeof("data") - 1, data);