add region collection

This commit is contained in:
daan 2019-07-15 14:53:03 -07:00
parent 89bdcd43b2
commit 7ea9cf8d1f
4 changed files with 33 additions and 0 deletions

View file

@ -147,6 +147,11 @@ static void mi_heap_collect_ex(mi_heap_t* heap, mi_collect_t collect)
if (collect >= FORCE) {
_mi_segment_thread_collect(&heap->tld->segments);
}
// collect regions
if (collect >= FORCE && _mi_is_main_thread()) {
_mi_mem_collect(&heap->tld->stats);
}
}
void _mi_heap_collect_abandon(mi_heap_t* heap) {