summaryrefslogtreecommitdiff
path: root/ext/spl/spl_heap.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2014-03-01 12:44:33 +0800
committerXinchen Hui <laruence@gmail.com>2014-03-01 12:44:33 +0800
commit171fde54917d8144edba7c70a931091b1032e741 (patch)
treea457b8d3655b76a62445a580a897bc5f44d88e76 /ext/spl/spl_heap.c
parent46ab80b48ef2acedfe8cbd091cae45621224c6f7 (diff)
downloadphp-git-171fde54917d8144edba7c70a931091b1032e741.tar.gz
Fixed SplPriorityQueue's free_obj
Diffstat (limited to 'ext/spl/spl_heap.c')
-rw-r--r--ext/spl/spl_heap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index b1be22db18..9b23eb2f03 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -247,7 +247,7 @@ static void spl_ptr_heap_insert(spl_ptr_heap *heap, zval *elem, void *cmp_userda
heap->ctor(elem TSRMLS_CC);
/* sifting up */
- for(i = heap->count++; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata TSRMLS_CC) < 0; i = (i-1)/2) {
+ for (i = heap->count++; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata TSRMLS_CC) < 0; i = (i-1)/2) {
heap->elements[i] = heap->elements[(i-1)/2];
}
@@ -1219,6 +1219,8 @@ PHP_MINIT_FUNCTION(spl_heap) /* {{{ */
spl_handler_SplPriorityQueue.clone_obj = spl_heap_object_clone;
spl_handler_SplPriorityQueue.count_elements = spl_heap_object_count_elements;
spl_handler_SplPriorityQueue.get_debug_info = spl_pqueue_object_get_debug_info;
+ spl_handler_SplPriorityQueue.dtor_obj = zend_objects_destroy_object;
+ spl_handler_SplPriorityQueue.free_obj = spl_heap_object_free_storage;
REGISTER_SPL_IMPLEMENTS(SplPriorityQueue, Iterator);
REGISTER_SPL_IMPLEMENTS(SplPriorityQueue, Countable);