From d508c3d61837f4f37100895b02d38d0df8de6a14 Mon Sep 17 00:00:00 2001 From: Daan Leijen Date: Mon, 20 Dec 2021 12:33:54 -0800 Subject: [PATCH] ensure in debug mode that all allocated block are initialized with MI_DEBUG_UNINIT (issue #501) --- src/page.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/page.c b/src/page.c index c0659395..3368bad1 100644 --- a/src/page.c +++ b/src/page.c @@ -621,7 +621,11 @@ static void mi_page_init(mi_heap_t* heap, mi_page_t* page, size_t block_size, mi page->keys[0] = _mi_heap_random_next(heap); page->keys[1] = _mi_heap_random_next(heap); #endif + #if MI_DEBUG > 0 + page->is_zero = false; // ensure in debug mode we initialize with MI_DEBUG_UNINIT, see issue #501 + #else page->is_zero = page->is_zero_init; + #endif mi_assert_internal(page->capacity == 0); mi_assert_internal(page->free == NULL);