mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 23:39:31 +03:00
update option names
This commit is contained in:
parent
dd4b6fc078
commit
274bcb61db
4 changed files with 7 additions and 7 deletions
|
@ -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
|
// 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.
|
// 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_used_at_frac(page,8)
|
||||||
// && !mi_page_is_abandoned_mapped(page)
|
// && !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 (?)
|
(_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
|
// first remove it from the abandoned pages in the arena -- this waits for any readers to finish
|
||||||
_mi_arenas_page_unabandon(page);
|
_mi_arenas_page_unabandon(page);
|
||||||
_mi_heap_page_reclaim(tagheap, page);
|
_mi_heap_page_reclaim(tagheap, page);
|
||||||
|
|
|
@ -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->memid = memid;
|
||||||
heap->tld = tld; // avoid reading the thread-local tld during initialization
|
heap->tld = tld; // avoid reading the thread-local tld during initialization
|
||||||
heap->exclusive_arena = _mi_arena_from_id(arena_id);
|
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->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->page_full_retain = mi_option_get_clamp(mi_option_page_full_retain, -1, 32);
|
||||||
heap->tag = heap_tag;
|
heap->tag = heap_tag;
|
||||||
|
|
|
@ -259,7 +259,7 @@ static void mi_heap_main_init(void) {
|
||||||
//heap_main.keys[0] = _mi_heap_random_next(&heap_main);
|
//heap_main.keys[0] = _mi_heap_random_next(&heap_main);
|
||||||
//heap_main.keys[1] = _mi_heap_random_next(&heap_main);
|
//heap_main.keys[1] = _mi_heap_random_next(&heap_main);
|
||||||
_mi_heap_guarded_init(&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.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);
|
heap_main.page_full_retain = mi_option_get_clamp(mi_option_page_full_retain, -1, 32);
|
||||||
}
|
}
|
||||||
|
|
|
@ -303,12 +303,12 @@ int main(int argc, char** argv) {
|
||||||
mi_option_enable(mi_option_visit_abandoned);
|
mi_option_enable(mi_option_visit_abandoned);
|
||||||
#endif
|
#endif
|
||||||
#if !defined(NDEBUG) && !defined(USE_STD_MALLOC)
|
#if !defined(NDEBUG) && !defined(USE_STD_MALLOC)
|
||||||
mi_option_set(mi_option_arena_reserve, 32 * 1024 /* in kib = 32MiB */);
|
// 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_purge_delay,1);
|
||||||
#endif
|
#endif
|
||||||
#if defined(NDEBUG) && !defined(USE_STD_MALLOC)
|
#if defined(NDEBUG) && !defined(USE_STD_MALLOC)
|
||||||
// mi_option_set(mi_option_purge_delay,-1);
|
// 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
|
#endif
|
||||||
#ifndef USE_STD_MALLOC
|
#ifndef USE_STD_MALLOC
|
||||||
mi_stats_reset();
|
mi_stats_reset();
|
||||||
|
|
Loading…
Add table
Reference in a new issue