diff options
Diffstat (limited to 'gcc/fibonacci_heap.c')
-rw-r--r-- | gcc/fibonacci_heap.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/fibonacci_heap.c b/gcc/fibonacci_heap.c index bddd047..2470715 100644 --- a/gcc/fibonacci_heap.c +++ b/gcc/fibonacci_heap.c @@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" #include "coretypes.h" +#include "alloc-pool.h" #include "fibonacci_heap.h" #include "selftest.h" @@ -38,13 +39,14 @@ typedef fibonacci_heap <int, int> int_heap_t; static void test_empty_heap () { - int_heap_t *h1 = new int_heap_t (INT_MIN); + pool_allocator allocator ("fibheap test", sizeof (int_heap_node_t)); + int_heap_t *h1 = new int_heap_t (INT_MIN, &allocator); ASSERT_TRUE (h1->empty ()); ASSERT_EQ (0, h1->nodes ()); ASSERT_EQ (NULL, h1->min ()); - int_heap_t *h2 = new int_heap_t (INT_MIN); + int_heap_t *h2 = new int_heap_t (INT_MIN, &allocator); int_heap_t *r = h1->union_with (h2); ASSERT_TRUE (r->empty ()); @@ -169,12 +171,13 @@ static void test_union () { int value = 777; + pool_allocator allocator ("fibheap test", sizeof (int_heap_node_t)); - int_heap_t *heap1 = new int_heap_t (INT_MIN); + int_heap_t *heap1 = new int_heap_t (INT_MIN, &allocator); for (unsigned i = 0; i < 2 * TEST_HEAP_N; i++) heap1->insert (i, &value); - int_heap_t *heap2 = new int_heap_t (INT_MIN); + int_heap_t *heap2 = new int_heap_t (INT_MIN, &allocator); for (unsigned i = 2 * TEST_HEAP_N; i < 3 * TEST_HEAP_N; i++) heap2->insert (i, &value); @@ -196,12 +199,13 @@ static void test_union_of_equal_heaps () { int value = 777; + pool_allocator allocator ("fibheap test", sizeof (int_heap_node_t)); - int_heap_t *heap1 = new int_heap_t (INT_MIN); + int_heap_t *heap1 = new int_heap_t (INT_MIN, &allocator); for (unsigned i = 0; i < TEST_HEAP_N; i++) heap1->insert (i, &value); - int_heap_t *heap2 = new int_heap_t (INT_MIN); + int_heap_t *heap2 = new int_heap_t (INT_MIN, &allocator); for (unsigned i = 0; i < TEST_HEAP_N; i++) heap2->insert (i, &value); |