From 9bad269c518a4104ac13584bc9474e0e357efd1c Mon Sep 17 00:00:00 2001 From: daanx Date: Mon, 23 Dec 2024 16:47:01 -0800 Subject: [PATCH] fix purge delay check for arenas --- src/arena.c | 2 +- src/options.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arena.c b/src/arena.c index 9ae44d85..af0d1d0a 100644 --- a/src/arena.c +++ b/src/arena.c @@ -1551,7 +1551,7 @@ static void mi_arenas_try_purge(bool force, bool visit_all, mi_tld_t* tld) mi_subproc_t* subproc = tld->subproc; const mi_msecs_t now = _mi_clock_now(); mi_msecs_t arenas_expire = mi_atomic_load_acquire(&subproc->purge_expire); - if (!force && (arenas_expire == 0 || arenas_expire < now)) return; + if (!force && (arenas_expire == 0 || arenas_expire > now)) return; const size_t max_arena = mi_arenas_get_count(subproc); if (max_arena == 0) return; diff --git a/src/options.c b/src/options.c index 7562cd46..63d8a68f 100644 --- a/src/options.c +++ b/src/options.c @@ -144,7 +144,7 @@ static mi_option_desc_t options[_mi_option_last] = #else { 1, UNINIT, MI_OPTION(eager_commit_delay) }, // the first N segments per thread are not eagerly committed (but per page in the segment on demand) #endif - { 1000,UNINIT, MI_OPTION_LEGACY(purge_delay,reset_delay) }, // purge delay in milli-seconds + { 500, UNINIT, MI_OPTION_LEGACY(purge_delay,reset_delay) }, // purge delay in milli-seconds { 0, UNINIT, MI_OPTION(use_numa_nodes) }, // 0 = use available numa nodes, otherwise use at most N nodes. { 0, UNINIT, MI_OPTION_LEGACY(disallow_os_alloc,limit_os_alloc) }, // 1 = do not use OS memory for allocation (but only reserved arenas) { 100, UNINIT, MI_OPTION(os_tag) }, // only apple specific for now but might serve more or less related purpose