Skip test_alignment_and_size if percpu_arena is enabled.

test_alignment_and_size needs a lot of memory.  When percpu_arena is enabled,
multiple arenas may cause the test to OOM.
This commit is contained in:
Qi Wang 2018-01-12 16:09:51 -08:00 committed by Qi Wang
parent 548153e789
commit 6b35366ef5

View File

@ -151,9 +151,17 @@ TEST_BEGIN(test_basic) {
TEST_END TEST_END
TEST_BEGIN(test_alignment_and_size) { TEST_BEGIN(test_alignment_and_size) {
const char *percpu_arena;
size_t sz = sizeof(percpu_arena);
if(mallctl("opt.percpu_arena", &percpu_arena, &sz, NULL, 0) ||
strcmp(percpu_arena, "disabled") != 0) {
test_skip("test_alignment_and_size skipped: "
"not working with percpu arena.");
};
#define MAXALIGN (((size_t)1) << 23) #define MAXALIGN (((size_t)1) << 23)
#define NITER 4 #define NITER 4
size_t nsz, rsz, sz, alignment, total; size_t nsz, rsz, alignment, total;
unsigned i; unsigned i;
void *ps[NITER]; void *ps[NITER];