mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
quick exit from try_reclaim if no abandoned segments
This commit is contained in:
parent
931d523dcc
commit
1b3eb8ef28
1 changed files with 2 additions and 0 deletions
|
@ -926,6 +926,8 @@ void _mi_abandoned_reclaim_all(mi_heap_t* heap, mi_segments_tld_t* tld) {
|
||||||
static mi_segment_t* mi_segment_try_reclaim(mi_heap_t* heap, size_t block_size, mi_page_kind_t page_kind, bool* reclaimed, mi_segments_tld_t* tld)
|
static mi_segment_t* mi_segment_try_reclaim(mi_heap_t* heap, size_t block_size, mi_page_kind_t page_kind, bool* reclaimed, mi_segments_tld_t* tld)
|
||||||
{
|
{
|
||||||
*reclaimed = false;
|
*reclaimed = false;
|
||||||
|
if (mi_atomic_load_relaxed(&abandoned_count) == 0) return NULL;
|
||||||
|
|
||||||
mi_segment_t* segment;
|
mi_segment_t* segment;
|
||||||
mi_arena_id_t current_id = 0;
|
mi_arena_id_t current_id = 0;
|
||||||
size_t current_idx = 0;
|
size_t current_idx = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue