use heap_stat_decrease when possible

This commit is contained in:
Daan Leijen 2022-04-07 09:48:08 -07:00
parent 5a90a2a9a1
commit 9f6cbc50ee

View File

@ -371,12 +371,12 @@ void _mi_page_free(mi_page_t* page, mi_page_queue_t* pq, bool force) {
const size_t bsize = mi_page_block_size(page);
if (bsize > MI_MEDIUM_OBJ_SIZE_MAX) {
if (bsize <= MI_LARGE_OBJ_SIZE_MAX) {
_mi_stat_decrease(&heap->tld->stats.large, bsize);
mi_heap_stat_decrease(heap, large, bsize);
}
else {
// not strictly necessary as we never get here for a huge page
mi_assert_internal(false);
_mi_stat_decrease(&heap->tld->stats.huge, bsize);
mi_heap_stat_decrease(heap, huge, bsize);
}
}