mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 15:29:31 +03:00
fix search_idx start in managed arenas
This commit is contained in:
parent
da79629308
commit
217871cb45
1 changed files with 1 additions and 1 deletions
|
@ -105,7 +105,7 @@ static bool mi_arena_alloc(mi_arena_t* arena, size_t blocks, mi_bitmap_index_t*
|
||||||
{
|
{
|
||||||
size_t idx = mi_atomic_load_relaxed(&arena->search_idx); // start from last search; ok to be relaxed as the exact start does not matter
|
size_t idx = mi_atomic_load_relaxed(&arena->search_idx); // start from last search; ok to be relaxed as the exact start does not matter
|
||||||
if (_mi_bitmap_try_find_from_claim_across(arena->blocks_inuse, arena->field_count, idx, blocks, bitmap_idx)) {
|
if (_mi_bitmap_try_find_from_claim_across(arena->blocks_inuse, arena->field_count, idx, blocks, bitmap_idx)) {
|
||||||
mi_atomic_store_relaxed(&arena->search_idx, idx); // start search from here next time
|
mi_atomic_store_relaxed(&arena->search_idx, mi_bitmap_index_field(*bitmap_idx)); // start search from found location next time around
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue