destroy the page map as well if MIMALLOC_DESTROY_ON_EXIT is set; see issue #1041

This commit is contained in:
daanx 2025-05-12 22:05:15 -07:00
parent 36e1cbfdbc
commit 3ef6784455
6 changed files with 43 additions and 5 deletions

View file

@ -396,6 +396,7 @@ void _mi_page_free(mi_page_t* page, mi_page_queue_t* pq) {
// and free it
mi_heap_t* heap = page->heap;
mi_heap_stat_decrease(heap, page_bins[mi_page_bin(page)], 1);
mi_heap_stat_decrease(heap, pages, 1);
mi_page_set_heap(page,NULL);
_mi_arenas_page_free(page);
_mi_arenas_collect(false, false, heap->tld); // allow purging