summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2023-03-21 14:12:12 -0700
committerQi Wang <interwq@gmail.com>2023-03-22 15:16:43 -0700
commit8b64be34414e92fcbcdbaf5b81db6d26289667b5 (patch)
tree2548690cc437529060c3daba33429635e0b901c8
parent8e7353a19b5fd9dd1041307b884bc969065b63af (diff)
downloadjemalloc-8b64be34414e92fcbcdbaf5b81db6d26289667b5.tar.gz
Explicit arena assignment in test_tcache_max.
Otherwise the associated arena could change with percpu arena enabled.
-rw-r--r--test/unit/tcache_max.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit/tcache_max.c b/test/unit/tcache_max.c
index 1f657c85..b1093f40 100644
--- a/test/unit/tcache_max.c
+++ b/test/unit/tcache_max.c
@@ -157,6 +157,13 @@ TEST_BEGIN(test_tcache_max) {
test_skip_if(opt_prof);
test_skip_if(san_uaf_detection_enabled());
+ unsigned arena_ind;
+ size_t sz = sizeof(arena_ind);
+ expect_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0),
+ 0, "Unexpected mallctl() failure");
+ expect_d_eq(mallctl("thread.arena", NULL, NULL, &arena_ind,
+ sizeof(arena_ind)), 0, "Unexpected mallctl() failure");
+
for (alloc_option = alloc_option_start;
alloc_option < alloc_option_end;
alloc_option++) {