mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
experimental destroy_on_exit option for statically linked mimalloc in a dynamically unloaded DLL
This commit is contained in:
parent
18cf94dff6
commit
35d332141d
6 changed files with 25 additions and 4 deletions
15
src/heap.c
15
src/heap.c
|
@ -327,7 +327,20 @@ void mi_heap_destroy(mi_heap_t* heap) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void _mi_heap_destroy_all(void) {
|
||||
mi_heap_t* bheap = mi_heap_get_backing();
|
||||
mi_heap_t* curr = bheap->tld->heaps;
|
||||
while (curr != NULL) {
|
||||
mi_heap_t* next = curr->next;
|
||||
if (curr->no_reclaim) {
|
||||
mi_heap_destroy(curr);
|
||||
}
|
||||
else {
|
||||
_mi_heap_destroy_pages(curr);
|
||||
}
|
||||
curr = next;
|
||||
}
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
Safe Heap delete
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue