mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
fix type warning on clang
This commit is contained in:
parent
3090f23c25
commit
8045d55179
1 changed files with 2 additions and 2 deletions
|
@ -826,12 +826,12 @@ mi_segment_t* _mi_arena_segment_clear_abandoned_next(mi_arena_field_cursor_t* pr
|
||||||
if (arena != NULL) {
|
if (arena != NULL) {
|
||||||
// visit the abandoned fields (starting at previous_idx)
|
// visit the abandoned fields (starting at previous_idx)
|
||||||
for ( ; field_idx < arena->field_count; field_idx++, bit_idx = 0) {
|
for ( ; field_idx < arena->field_count; field_idx++, bit_idx = 0) {
|
||||||
mi_bitmap_field_t field = mi_atomic_load_relaxed(&arena->blocks_abandoned[field_idx]);
|
size_t field = mi_atomic_load_relaxed(&arena->blocks_abandoned[field_idx]);
|
||||||
if mi_unlikely(field != 0) { // skip zero fields quickly
|
if mi_unlikely(field != 0) { // skip zero fields quickly
|
||||||
// visit each set bit in the field (todo: maybe use `ctz` here?)
|
// visit each set bit in the field (todo: maybe use `ctz` here?)
|
||||||
for ( ; bit_idx < MI_BITMAP_FIELD_BITS; bit_idx++) {
|
for ( ; bit_idx < MI_BITMAP_FIELD_BITS; bit_idx++) {
|
||||||
// pre-check if the bit is set
|
// pre-check if the bit is set
|
||||||
mi_bitmap_field_t mask = ((mi_bitmap_field_t)1 << bit_idx);
|
size_t mask = ((size_t)1 << bit_idx);
|
||||||
if mi_unlikely((field & mask) == mask) {
|
if mi_unlikely((field & mask) == mask) {
|
||||||
mi_bitmap_index_t bitmap_idx = mi_bitmap_index_create(field_idx, bit_idx);
|
mi_bitmap_index_t bitmap_idx = mi_bitmap_index_create(field_idx, bit_idx);
|
||||||
// try to reclaim it atomically
|
// try to reclaim it atomically
|
||||||
|
|
Loading…
Add table
Reference in a new issue