diff --git a/src/free.c b/src/free.c index 5d9628f0..865efafa 100644 --- a/src/free.c +++ b/src/free.c @@ -217,7 +217,7 @@ static void mi_decl_noinline mi_free_try_collect_mt(mi_page_t* page) mi_attr_noe // 2. if the page is not too full, we can try to reclaim it for ourselves // note: this seems a bad idea but it speeds up some benchmarks (like `larson`) quite a bit. - if (_mi_option_get_fast(mi_option_reclaim_on_free) != 0 && + if (_mi_option_get_fast(mi_option_page_reclaim_on_free) != 0 && !mi_page_is_used_at_frac(page,8) // && !mi_page_is_abandoned_mapped(page) ) @@ -237,7 +237,7 @@ static void mi_decl_noinline mi_free_try_collect_mt(mi_page_t* page) mi_attr_noe (_mi_arena_memid_is_suitable(page->memid, tagheap->exclusive_arena)) // don't reclaim across unsuitable arena's; todo: inline arena_is_suitable (?) ) { - if (mi_page_queue(tagheap, page->block_size)->first != NULL) { // don't reclaim for an block_size we don't use + if (mi_page_queue(tagheap, page->block_size)->first != NULL) { // don't reclaim for a block_size we don't use // first remove it from the abandoned pages in the arena -- this waits for any readers to finish _mi_arenas_page_unabandon(page); _mi_heap_page_reclaim(tagheap, page); diff --git a/src/heap.c b/src/heap.c index 82ca05cb..1ae7e99f 100644 --- a/src/heap.c +++ b/src/heap.c @@ -175,7 +175,7 @@ void _mi_heap_init(mi_heap_t* heap, mi_arena_id_t arena_id, bool allow_destroy, heap->memid = memid; heap->tld = tld; // avoid reading the thread-local tld during initialization heap->exclusive_arena = _mi_arena_from_id(arena_id); - heap->allow_page_reclaim = (!allow_destroy && mi_option_is_enabled(mi_option_reclaim_on_free)); + heap->allow_page_reclaim = (!allow_destroy && mi_option_is_enabled(mi_option_page_reclaim_on_free)); heap->allow_page_abandon = (!allow_destroy && mi_option_get(mi_option_page_full_retain) >= 0); heap->page_full_retain = mi_option_get_clamp(mi_option_page_full_retain, -1, 32); heap->tag = heap_tag; diff --git a/src/init.c b/src/init.c index ac49d292..33c9794d 100644 --- a/src/init.c +++ b/src/init.c @@ -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_reclaim_on_free); + heap_main.allow_page_reclaim = mi_option_is_enabled(mi_option_page_reclaim_on_free); 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); } diff --git a/test/test-stress.c b/test/test-stress.c index fb27a786..303d9f42 100644 --- a/test/test-stress.c +++ b/test/test-stress.c @@ -303,12 +303,12 @@ int main(int argc, char** argv) { mi_option_enable(mi_option_visit_abandoned); #endif #if !defined(NDEBUG) && !defined(USE_STD_MALLOC) - mi_option_set(mi_option_arena_reserve, 32 * 1024 /* in kib = 32MiB */); - mi_option_set(mi_option_purge_delay,1); + // mi_option_set(mi_option_arena_reserve, 32 * 1024 /* in kib = 32MiB */); + // mi_option_set(mi_option_purge_delay,1); #endif #if defined(NDEBUG) && !defined(USE_STD_MALLOC) // mi_option_set(mi_option_purge_delay,-1); - mi_option_set(mi_option_reclaim_on_free, 0); + mi_option_set(mi_option_page_reclaim_on_free, 0); #endif #ifndef USE_STD_MALLOC mi_stats_reset();