com php-src: Fixed SplPriorityQueue's free_obj: ext/spl/s pl_heap.c
| From: | Dmitry Stogov | Date: | Sat, 01 Mar 2014 04:44:33 +0000 |
| Subject: | com php-src: Fixed SplPriorityQueue's free_obj: ext/spl/s pl_heap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77822@lists.php.net to get a copy of this message | ||
Commit: 171fde54917d8144edba7c70a931091b1032e741
Author: Xinchen Hui <laruence@gmail.com> Sat, 1 Mar 2014 12:44:33 +0800
Parents: 46ab80b48ef2acedfe8cbd091cae45621224c6f7
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=171fde54917d8144edba7c70a931091b1032e741
Log:
Fixed SplPriorityQueue's free_obj
Changed paths:
M ext/spl/spl_heap.c
Diff:
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index b1be22d..9b23eb2 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);