mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 15:29:31 +03:00
make target test for stealing one less since we are about to reclaim_or_alloc a fresh segment
This commit is contained in:
parent
19ce2c6461
commit
81da26d7d3
1 changed files with 3 additions and 2 deletions
|
@ -1424,7 +1424,8 @@ static void mi_segment_force_abandon(mi_segment_t* segment, mi_segments_tld_t* t
|
|||
// this should be called from `reclaim_or_alloc` so we know all segments are (about) fully in use.
|
||||
static void mi_segments_try_abandon(mi_heap_t* heap, mi_segments_tld_t* tld) {
|
||||
const size_t target = (size_t)mi_option_get_clamp(mi_option_target_segments_per_thread,0,1024);
|
||||
if (target == 0 || tld->count <= target) return;
|
||||
// we call this when we are about to add a fresh segment so we should be under our target segment count.
|
||||
if (target == 0 || tld->count < target) return;
|
||||
|
||||
const size_t min_target = (target > 4 ? (target*3)/4 : target); // 75%
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue