Skip to content

Commit 4a8abbb

Browse files
committed
Fix bitmap_sfu() regression.
Fix bitmap_sfu() to shift by LG_BITMAP_GROUP_NBITS rather than hard-coded 6 when using linear (non-USE_TREE) bitmap search. In practice this affects only 64-bit systems for which sizeof(long) is not 8 (i.e. Windows), since USE_TREE is defined for 32-bit systems. This regression was caused by b8823ab (Use linear scan for small bitmaps). This resolves jemalloc#368.
1 parent a3c4193 commit 4a8abbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/jemalloc/internal/bitmap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ bitmap_sfu(bitmap_t *bitmap, const bitmap_info_t *binfo)
223223
i++;
224224
g = bitmap[i];
225225
}
226-
bit = (bit - 1) + (i << 6);
226+
bit = (bit - 1) + (i << LG_BITMAP_GROUP_NBITS);
227227
#endif
228228
bitmap_set(bitmap, binfo, bit);
229229
return (bit);

0 commit comments

Comments
 (0)