From 1fa591cc891c1631fd475ee4ccc695c912eda4f7 Mon Sep 17 00:00:00 2001 From: Daan Date: Fri, 21 Mar 2025 17:38:39 -0700 Subject: [PATCH] attempt to fix test pipeline on x86 --- test/test-api.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/test-api.c b/test/test-api.c index cef9c293..20d85314 100644 --- a/test/test-api.c +++ b/test/test-api.c @@ -203,12 +203,15 @@ int main(void) { CHECK_BODY("malloc-aligned9") { // test large alignments bool ok = true; void* p[8]; - size_t sizes[8] = { 8, 512, 1024 * 1024, MI_PAGE_MAX_OVERALLOC_ALIGN, MI_PAGE_MAX_OVERALLOC_ALIGN + 1, + const int max_align_shift = #if SIZE_MAX > UINT32_MAX - 2 * MI_PAGE_MAX_OVERALLOC_ALIGN, 8 * MI_PAGE_MAX_OVERALLOC_ALIGN, + 28 + #else + 20 #endif - 0 }; - for (int i = 0; i < 28 && ok; i++) { + ; + size_t sizes[8] = { 8, 512, 1024 * 1024, MI_PAGE_MAX_OVERALLOC_ALIGN, MI_PAGE_MAX_OVERALLOC_ALIGN + 1, 2 * MI_PAGE_MAX_OVERALLOC_ALIGN, 8 * MI_PAGE_MAX_OVERALLOC_ALIGN, 0 }; + for (int i = 0; i < max_align_shift && ok; i++) { int align = (1 << i); for (int j = 0; j < 8 && ok; j++) { p[j] = mi_zalloc_aligned(sizes[j], align);