Avoid assuming the arena id in test when percpu_arena is used.

This commit is contained in:
Qi Wang 2023-03-10 13:15:59 -08:00 committed by Qi Wang
parent f743690739
commit 71bc1a3d91

View File

@ -82,6 +82,9 @@ TEST_BEGIN(huge_allocation) {
expect_u_gt(arena1, 0, "Huge allocation should not come from arena 0"); expect_u_gt(arena1, 0, "Huge allocation should not come from arena 0");
dallocx(ptr, 0); dallocx(ptr, 0);
test_skip_if(have_percpu_arena &&
PERCPU_ARENA_ENABLED(opt_percpu_arena));
ptr = mallocx(HUGE_SZ >> 1, 0); ptr = mallocx(HUGE_SZ >> 1, 0);
expect_ptr_not_null(ptr, "Fail to allocate half huge size"); expect_ptr_not_null(ptr, "Fail to allocate half huge size");
expect_d_eq(mallctl("arenas.lookup", &arena2, &sz, &ptr, expect_d_eq(mallctl("arenas.lookup", &arena2, &sz, &ptr,