add delay to purg'ing; call collect_retired every N generic allocs

This commit is contained in:
daanx 2024-12-15 19:54:01 -08:00
parent 3330d4353a
commit d2f670e6e5
4 changed files with 24 additions and 27 deletions

View file

@ -409,6 +409,7 @@ struct mi_heap_s {
size_t page_retired_max; // largest retired index into the `pages` array.
mi_heap_t* next; // list of heaps per thread
mi_memid_t memid; // provenance of the heap struct itseft (meta or os)
long generic_count;
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
bool allow_page_abandon; // `true` if this heap can abandon pages to reduce memory footprint