summaryrefslogtreecommitdiff
path: root/src/segment-cache.c
diff options
context:
space:
mode:
authorDaan <daanl@outlook.com>2022-02-03 15:51:27 -0800
committerDaan <daanl@outlook.com>2022-02-03 15:51:27 -0800
commit0e1beb0018f45ab13bdfd567f67d7deecd08084f (patch)
tree08f8a8eef424f8b2ef4c94644b11002fe0ead2b5 /src/segment-cache.c
parentcbcee4dce481b94613d255c6b5e3442436b63036 (diff)
check for decommit allowed before purging the segment cache
Diffstat (limited to 'src/segment-cache.c')
-rw-r--r--src/segment-cache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/segment-cache.c b/src/segment-cache.c
index 9b838ce..93908c8 100644
--- a/src/segment-cache.c
+++ b/src/segment-cache.c
@@ -118,6 +118,7 @@ static mi_decl_noinline void mi_commit_mask_decommit(mi_commit_mask_t* cmask, vo
static mi_decl_noinline void mi_segment_cache_purge(bool force, mi_os_tld_t* tld)
{
MI_UNUSED(tld);
+ if (!mi_option_is_enabled(mi_option_allow_decommit)) return;
mi_msecs_t now = _mi_clock_now();
size_t purged = 0;
const size_t max_visits = (force ? MI_CACHE_MAX /* visit all */ : MI_CACHE_FIELDS /* probe at most N (=16) slots */);