MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / mi_heap_destroy

Function mi_heap_destroy

3rd/mimalloc-2.0.9/src/heap.c:333–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333void mi_heap_destroy(mi_heap_t* heap) {
334 mi_assert(heap != NULL);
335 mi_assert(mi_heap_is_initialized(heap));
336 mi_assert(heap->no_reclaim);
337 mi_assert_expensive(mi_heap_is_valid(heap));
338 if (heap==NULL || !mi_heap_is_initialized(heap)) return;
339 if (!heap->no_reclaim) {
340 // don't free in case it may contain reclaimed pages
341 mi_heap_delete(heap);
342 }
343 else {
344 // free all pages
345 _mi_heap_destroy_pages(heap);
346 mi_heap_free(heap);
347 }
348}
349
350void _mi_heap_destroy_all(void) {
351 mi_heap_t* bheap = mi_heap_get_backing();

Callers 5

mainFunction · 0.85
test_heap1Function · 0.85
test_heapFunction · 0.85
_mi_heap_destroy_allFunction · 0.85
heap_destroyMethod · 0.85

Calls 5

mi_heap_is_initializedFunction · 0.85
mi_heap_is_validFunction · 0.85
mi_heap_deleteFunction · 0.85
_mi_heap_destroy_pagesFunction · 0.85
mi_heap_freeFunction · 0.85

Tested by 3

mainFunction · 0.68
test_heap1Function · 0.68
test_heapFunction · 0.68