diff --git a/include/mimalloc/types.h b/include/mimalloc/types.h index cc912752..3388b63a 100644 --- a/include/mimalloc/types.h +++ b/include/mimalloc/types.h @@ -400,6 +400,7 @@ struct mi_heap_s { size_t page_count; // total number of pages in the `pages` queues. size_t page_retired_min; // smallest retired index (retired pages are fully free, but still in the page queues) size_t page_retired_max; // largest retired index into the `pages` array. + size_t generic_count; // how often is mimalloc_generic invoked? mi_heap_t* next; // list of heaps per thread long full_page_retain; // how many full pages can be retained per queue (before abondoning them) bool allow_page_reclaim; // `true` if this heap should not reclaim abandoned pages diff --git a/src/init.c b/src/init.c index 673fdb55..af21bc5d 100644 --- a/src/init.c +++ b/src/init.c @@ -119,6 +119,7 @@ mi_decl_cache_align const mi_heap_t _mi_heap_empty = { { {0}, {0}, 0, true }, // random 0, // page count MI_BIN_FULL, 0, // page retired min/max + 0, // generic count NULL, // next 0, // full page retain false, // can reclaim @@ -155,6 +156,7 @@ mi_decl_cache_align mi_heap_t heap_main = { { {0x846ca68b}, {0}, 0, true }, // random 0, // page count MI_BIN_FULL, 0, // page retired min/max + 0, // generic count NULL, // next heap 2, // full page retain true, // allow page reclaim diff --git a/src/page.c b/src/page.c index af30392a..52c5167b 100644 --- a/src/page.c +++ b/src/page.c @@ -878,7 +878,7 @@ void* _mi_malloc_generic(mi_heap_t* heap, size_t size, bool zero, size_t huge_al // call potential deferred free routines _mi_deferred_free(heap, false); // collect retired pages - _mi_heap_collect_retired(heap,false); + _mi_heap_collect_retired(heap, false); } // find (or allocate) a page of the right size