make page_reclaim_on_free 0 by default; but allow reclaim_on_free if the page was originally in this heap (just as in v2 with the full queue)

This commit is contained in:
daanx 2025-02-05 15:41:37 -08:00
parent 5fbba3f20c
commit 5aa679cdee
5 changed files with 36 additions and 38 deletions

View file

@ -259,7 +259,7 @@ static void mi_heap_main_init(void) {
//heap_main.keys[0] = _mi_heap_random_next(&heap_main);
//heap_main.keys[1] = _mi_heap_random_next(&heap_main);
_mi_heap_guarded_init(&heap_main);
heap_main.allow_page_reclaim = mi_option_is_enabled(mi_option_page_reclaim_on_free);
heap_main.allow_page_reclaim = (mi_option_get(mi_option_page_reclaim_on_free) >= 0);
heap_main.allow_page_abandon = (mi_option_get(mi_option_page_full_retain) >= 0);
heap_main.page_full_retain = mi_option_get_clamp(mi_option_page_full_retain, -1, 32);
}