From 8c83c021b0c2180d21c79a00c45c41ba8d7f4eee Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Wed, 6 Apr 2016 10:32:06 -0700 Subject: [PATCH] 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 b8823ab02607d6f03febd32ac504bb6188c54047 (Use linear scan for small bitmaps). This resolves #368. --- include/jemalloc/internal/bitmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/jemalloc/internal/bitmap.h b/include/jemalloc/internal/bitmap.h index 2594e3a4..0e0d2476 100644 --- a/include/jemalloc/internal/bitmap.h +++ b/include/jemalloc/internal/bitmap.h @@ -223,7 +223,7 @@ bitmap_sfu(bitmap_t *bitmap, const bitmap_info_t *binfo) i++; g = bitmap[i]; } - bit = (bit - 1) + (i << 6); + bit = (bit - 1) + (i << LG_BITMAP_GROUP_NBITS); #endif bitmap_set(bitmap, binfo, bit); return (bit);