mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 23:19:31 +03:00
Merge branch 'dev' of https://github.com/microsoft/mimalloc into dev
This commit is contained in:
commit
b7087d3625
1 changed files with 1 additions and 1 deletions
|
@ -179,7 +179,7 @@ static bool mi_bitmap_try_find_claim_field_across(mi_bitmap_t bitmap, size_t bit
|
||||||
_Atomic(uintptr_t)* field = &bitmap[idx];
|
_Atomic(uintptr_t)* field = &bitmap[idx];
|
||||||
uintptr_t map = mi_atomic_load_relaxed(field);
|
uintptr_t map = mi_atomic_load_relaxed(field);
|
||||||
const size_t initial = mi_clz(map); // count of initial zeros starting at idx
|
const size_t initial = mi_clz(map); // count of initial zeros starting at idx
|
||||||
mi_assert_internal(initial >= 0 && initial <= MI_BITMAP_FIELD_BITS);
|
mi_assert_internal(initial <= MI_BITMAP_FIELD_BITS);
|
||||||
if (initial == 0) return false;
|
if (initial == 0) return false;
|
||||||
if (initial >= count) return _mi_bitmap_try_find_claim_field(bitmap, idx, count, bitmap_idx); // no need to cross fields
|
if (initial >= count) return _mi_bitmap_try_find_claim_field(bitmap, idx, count, bitmap_idx); // no need to cross fields
|
||||||
if (_mi_divide_up(count - initial, MI_BITMAP_FIELD_BITS) >= (bitmap_fields - idx)) return false; // not enough entries
|
if (_mi_divide_up(count - initial, MI_BITMAP_FIELD_BITS) >= (bitmap_fields - idx)) return false; // not enough entries
|
||||||
|
|
Loading…
Add table
Reference in a new issue