Explicit arena assignment in test_tcache_max.

Otherwise the associated arena could change with percpu arena enabled.
This commit is contained in:
Qi Wang 2023-03-21 14:12:12 -07:00 committed by Qi Wang
parent 8e7353a19b
commit 8b64be3441

View File

@ -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++) {