mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
implement arena destroy on program exit
This commit is contained in:
parent
4c4f2f4084
commit
83aa635485
3 changed files with 82 additions and 22 deletions
|
@ -592,7 +592,7 @@ static void mi_cdecl mi_process_done(void) {
|
|||
// or C-runtime termination code.
|
||||
if (mi_option_is_enabled(mi_option_destroy_on_exit)) {
|
||||
_mi_heap_destroy_all(); // forcefully release all memory held by all heaps (of this thread only!)
|
||||
_mi_arena_collect(true,true,&_mi_heap_main_get()->tld->stats);
|
||||
_mi_arena_collect(true /* destroy (owned) arenas */, true /* purge the rest */, &_mi_heap_main_get()->tld->stats);
|
||||
}
|
||||
|
||||
if (mi_option_is_enabled(mi_option_show_stats) || mi_option_is_enabled(mi_option_verbose)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue