Disable forced purge for abandoned segments

This commit is contained in:
Sergiy Kuryata 2024-12-28 11:46:30 -08:00
parent df48b8b6c9
commit 08eee6ae82
2 changed files with 3 additions and 3 deletions

View file

@ -762,7 +762,7 @@ void mi_heap_drop_segment(mi_heap_t* heap, size_t targetSegmentCount, size_t all
// collect abandoned segments (in particular, purge expired parts of segments in the abandoned segment list)
// note: forced purge can be quite expensive if many threads are created/destroyed so we do not force on abandonment
_mi_abandoned_collect(heap, true /* force? */, &heap->tld->segments);
_mi_abandoned_collect(heap, false /* force? */, &heap->tld->segments);
}
}
}

View file

@ -1588,7 +1588,7 @@ static mi_segment_t* mi_segment_try_reclaim(mi_heap_t* heap, size_t needed_slice
mi_segment_t* segment_to_return = mi_segment_reclaim(segment, heap, block_size, reclaimed, tld);
if (segment_to_return != NULL) {
if (best_candidate_segment != NULL) {
mi_segment_try_purge(best_candidate_segment, true /* true force? */, tld->stats);
mi_segment_try_purge(best_candidate_segment, false /* true force? */, tld->stats);
_mi_arena_segment_mark_abandoned(best_candidate_segment);
}
mi_segment_increment_reclaimed_stats();
@ -1613,7 +1613,7 @@ static mi_segment_t* mi_segment_try_reclaim(mi_heap_t* heap, size_t needed_slice
segment_to_abandon = segment;
}
mi_segment_try_purge(segment_to_abandon, true /* true force? */, tld->stats); // force purge if needed as we may not visit soon again
mi_segment_try_purge(segment_to_abandon, false /* true force? */, tld->stats); // force purge if needed as we may not visit soon again
_mi_arena_segment_mark_abandoned(segment_to_abandon);
}