From 313008ecaa27b016e6bd78e1a83ebafe5fe381bb Mon Sep 17 00:00:00 2001 From: daan Date: Mon, 7 Sep 2020 15:20:59 -0700 Subject: [PATCH] ensure page->retire_expire is always 1 --- src/page.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/page.c b/src/page.c index 9d919cfa..d9b5412d 100644 --- a/src/page.c +++ b/src/page.c @@ -389,6 +389,7 @@ void _mi_page_free(mi_page_t* page, mi_page_queue_t* pq, bool force) { _mi_segment_page_free(page, force, segments_tld); } +// Retire parameters #define MI_MAX_RETIRE_SIZE MI_MEDIUM_OBJ_SIZE_MAX #define MI_RETIRE_CYCLES (8) @@ -415,7 +416,7 @@ void _mi_page_retire(mi_page_t* page) { if (mi_likely(page->xblock_size <= MI_MAX_RETIRE_SIZE && !mi_page_is_in_full(page))) { if (pq->last==page && pq->first==page) { // the only page in the queue? mi_stat_counter_increase(_mi_stats_main.page_no_retire,1); - page->retire_expire = (page->xblock_size <= MI_SMALL_OBJ_SIZE_MAX ? MI_RETIRE_CYCLES : MI_RETIRE_CYCLES/4); + page->retire_expire = 1 + (page->xblock_size <= MI_SMALL_OBJ_SIZE_MAX ? MI_RETIRE_CYCLES : MI_RETIRE_CYCLES/4); mi_heap_t* heap = mi_page_heap(page); mi_assert_internal(pq >= heap->pages); const size_t index = pq - heap->pages;