Merge branch 'dev3' into dev3-bin

This commit is contained in:
Daan 2025-02-06 17:08:16 -08:00
commit 1ee72dc6d6

View file

@ -804,7 +804,7 @@ mi_decl_noinline static bool mi_bchunk_try_find_and_clearNX(mi_bchunk_t* chunk,
const size_t post = mi_bfield_clz(~b); const size_t post = mi_bfield_clz(~b);
if (post > 0) { if (post > 0) {
const size_t pre = mi_bfield_ctz(~mi_atomic_load_relaxed(&chunk->bfields[i+1])); const size_t pre = mi_bfield_ctz(~mi_atomic_load_relaxed(&chunk->bfields[i+1]));
if (post + pre <= n) { if (post + pre >= n) {
// it fits -- try to claim it atomically // it fits -- try to claim it atomically
const size_t cidx = (i*MI_BFIELD_BITS) + (MI_BFIELD_BITS - post); const size_t cidx = (i*MI_BFIELD_BITS) + (MI_BFIELD_BITS - post);
if (mi_bchunk_try_clearNX(chunk, cidx, n, NULL)) { if (mi_bchunk_try_clearNX(chunk, cidx, n, NULL)) {