From e227341f5b60939fe287bdaf92f084d7ea4bf3c1 Mon Sep 17 00:00:00 2001 From: daan Date: Mon, 9 Sep 2019 07:54:36 -0700 Subject: [PATCH] fix mi_collect being called with empty heap (issue #150) --- src/heap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/heap.c b/src/heap.c index 417c19da..8465479e 100644 --- a/src/heap.c +++ b/src/heap.c @@ -108,9 +108,8 @@ static bool mi_heap_page_never_delayed_free(mi_heap_t* heap, mi_page_queue_t* pq static void mi_heap_collect_ex(mi_heap_t* heap, mi_collect_t collect) { - _mi_deferred_free(heap,collect > NORMAL); if (!mi_heap_is_initialized(heap)) return; - + _mi_deferred_free(heap, collect > NORMAL); // collect (some) abandoned pages if (collect >= NORMAL && !heap->no_reclaim) {