diff options
author | Daan Leijen <daan@microsoft.com> | 2022-04-14 16:05:49 -0700 |
---|---|---|
committer | Daan Leijen <daan@microsoft.com> | 2022-04-14 16:05:49 -0700 |
commit | f87cba9bd89f0a34838effa4366a73ddbe0963a6 (patch) | |
tree | f08d5a5a17aadbf61a79475f58283088de1febcb /src/segment.c | |
parent | fed9b254a10afee3699684849be643cdecfd5ace (diff) |
add max segment reclaim as an option
Diffstat (limited to 'src/segment.c')
-rw-r--r-- | src/segment.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/segment.c b/src/segment.c index 7526507..4554eba 100644 --- a/src/segment.c +++ b/src/segment.c @@ -1112,7 +1112,7 @@ static mi_segment_t* mi_segment_try_reclaim(mi_heap_t* heap, size_t block_size, { *reclaimed = false; mi_segment_t* segment; - int max_tries = 8; // limit the work to bound allocation times + long max_tries = mi_option_get_clamp(mi_option_max_segment_reclaim, 8, 1024); // limit the work to bound allocation times while ((max_tries-- > 0) && ((segment = mi_abandoned_pop()) != NULL)) { segment->abandoned_visits++; bool all_pages_free; |