mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 03:48:42 +03:00
add max segment reclaim as an option
This commit is contained in:
parent
fed9b254a1
commit
f87cba9bd8
5 changed files with 11 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue