summaryrefslogtreecommitdiffstats
path: root/test/unit/bitmap.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2017-04-16 16:25:56 (GMT)
committerJason Evans <jasone@canonware.com>2017-04-19 02:01:04 (GMT)
commit45f087eb033927338b9df847eb9be6886ef48cf7 (patch)
tree5d59a58674628b3d68e729df98945547a5917250 /test/unit/bitmap.c
parent38e847c1c594fb9ad4862233f3602ade85da4e7f (diff)
downloadjemalloc-45f087eb033927338b9df847eb9be6886ef48cf7.zip
jemalloc-45f087eb033927338b9df847eb9be6886ef48cf7.tar.gz
jemalloc-45f087eb033927338b9df847eb9be6886ef48cf7.tar.bz2
Revert "Remove BITMAP_USE_TREE."
Some systems use a native 64 KiB page size, which means that the bitmap for the smallest size class can be 8192 bits, not just 512 bits as when the page size is 4 KiB. Linear search in bitmap_{sfu,ffu}() is unacceptably slow for such large bitmaps. This reverts commit 7c00f04ff40a34627e31488d02ff1081c749c7ba.
Diffstat (limited to 'test/unit/bitmap.c')
-rw-r--r--test/unit/bitmap.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/bitmap.c b/test/unit/bitmap.c
index f65ed53..cafb203 100644
--- a/test/unit/bitmap.c
+++ b/test/unit/bitmap.c
@@ -103,8 +103,24 @@ test_bitmap_initializer_body(const bitmap_info_t *binfo, size_t nbits) {
assert_zu_eq(binfo->nbits, binfo_dyn.nbits,
"Unexpected difference between static and dynamic initialization, "
"nbits=%zu", nbits);
+#ifdef BITMAP_USE_TREE
+ assert_u_eq(binfo->nlevels, binfo_dyn.nlevels,
+ "Unexpected difference between static and dynamic initialization, "
+ "nbits=%zu", nbits);
+ {
+ unsigned i;
+
+ for (i = 0; i < binfo->nlevels; i++) {
+ assert_zu_eq(binfo->levels[i].group_offset,
+ binfo_dyn.levels[i].group_offset,
+ "Unexpected difference between static and dynamic "
+ "initialization, nbits=%zu, level=%u", nbits, i);
+ }
+ }
+#else
assert_zu_eq(binfo->ngroups, binfo_dyn.ngroups,
"Unexpected difference between static and dynamic initialization");
+#endif
}
TEST_BEGIN(test_bitmap_initializer) {