From 4d1d3471cff8e7285705fe590d46dcfe51e22d0c Mon Sep 17 00:00:00 2001 From: daanx Date: Tue, 24 Dec 2024 17:14:53 -0800 Subject: [PATCH] rename page options --- include/mimalloc.h | 4 ++-- src/heap.c | 4 ++-- src/init.c | 4 ++-- src/options.c | 4 ++-- src/page.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/mimalloc.h b/include/mimalloc.h index 5f856411..6432e41a 100644 --- a/include/mimalloc.h +++ b/include/mimalloc.h @@ -396,8 +396,8 @@ typedef enum mi_option_e { mi_option_guarded_sample_seed, // can be set to allow for a (more) deterministic re-execution when a guard page is triggered (=0) mi_option_target_segments_per_thread, // experimental (=0) mi_option_reclaim_on_free, // allow to reclaim an abandoned segment on a free (=1) - mi_option_full_page_retain, // retain N full pages per size class (=2) - mi_option_max_page_candidates, // max candidate pages to consider for allocation (=4) + mi_option_page_full_retain, // retain N full pages per size class (=2) + mi_option_page_max_candidates, // max candidate pages to consider for allocation (=4) mi_option_max_vabits, // max user space virtual address bits to consider (=48) mi_option_pagemap_commit, // commit the full pagemap (to always catch invalid pointer uses) (=0) mi_option_page_commit_on_demand, // commit page memory on-demand diff --git a/src/heap.c b/src/heap.c index f0d495a3..09cc2574 100644 --- a/src/heap.c +++ b/src/heap.c @@ -170,8 +170,8 @@ void _mi_heap_init(mi_heap_t* heap, mi_arena_id_t arena_id, bool noreclaim, uint heap->tld = tld; // avoid reading the thread-local tld during initialization heap->exclusive_arena = _mi_arena_from_id(arena_id); heap->allow_page_reclaim = !noreclaim; - heap->allow_page_abandon = (!noreclaim && mi_option_get(mi_option_full_page_retain) >= 0); - heap->full_page_retain = mi_option_get_clamp(mi_option_full_page_retain, -1, 32); + heap->allow_page_abandon = (!noreclaim && mi_option_get(mi_option_page_full_retain) >= 0); + heap->full_page_retain = mi_option_get_clamp(mi_option_page_full_retain, -1, 32); heap->tag = heap_tag; if (heap->tld->is_in_threadpool) { // if we run as part of a thread pool it is better to not arbitrarily reclaim abandoned pages into our heap. diff --git a/src/init.c b/src/init.c index 16c1dea4..4631d9d9 100644 --- a/src/init.c +++ b/src/init.c @@ -254,8 +254,8 @@ 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_abandon = (mi_option_get(mi_option_full_page_retain) >= 0); - heap_main.full_page_retain = mi_option_get_clamp(mi_option_full_page_retain, -1, 32); + heap_main.allow_page_abandon = (mi_option_get(mi_option_page_full_retain) >= 0); + heap_main.full_page_retain = mi_option_get_clamp(mi_option_page_full_retain, -1, 32); } } diff --git a/src/options.c b/src/options.c index b613f983..0d9bea28 100644 --- a/src/options.c +++ b/src/options.c @@ -170,8 +170,8 @@ static mi_option_desc_t options[_mi_option_last] = { 0, UNINIT, MI_OPTION(guarded_sample_seed)}, { 0, UNINIT, MI_OPTION(target_segments_per_thread) }, // abandon segments beyond this point, or 0 to disable. { 1, UNINIT, MI_OPTION_LEGACY(reclaim_on_free, abandoned_reclaim_on_free) },// reclaim an abandoned segment on a free - { 2, UNINIT, MI_OPTION(full_page_retain) }, - { 4, UNINIT, MI_OPTION(max_page_candidates) }, + { 2, UNINIT, MI_OPTION(page_full_retain) }, + { 4, UNINIT, MI_OPTION(page_max_candidates) }, { 0, UNINIT, MI_OPTION(max_vabits) }, { MI_DEFAULT_PAGEMAP_COMMIT, UNINIT, MI_OPTION(pagemap_commit) }, // commit the full pagemap upfront? diff --git a/src/page.c b/src/page.c index 542496a0..474d8d2d 100644 --- a/src/page.c +++ b/src/page.c @@ -721,7 +721,7 @@ static mi_decl_noinline mi_page_t* mi_page_queue_find_free_ex(mi_heap_t* heap, m // we prefer non-expandable pages with high usage as candidates (to reduce commit, and increase chances of free-ing up pages) if (page_candidate == NULL) { page_candidate = page; - candidate_limit = _mi_option_get_fast(mi_option_max_page_candidates); + candidate_limit = _mi_option_get_fast(mi_option_page_max_candidates); } else if (mi_page_all_free(page_candidate)) { _mi_page_free(page_candidate, pq);