From e3239d29bd692fd672e5258bb48744322c59a5cd Mon Sep 17 00:00:00 2001 From: dzaima Date: Mon, 24 Mar 2025 17:39:40 +0200 Subject: [PATCH] enable 32-byte alignment for array data --- src/opt/mm_buddyTemplate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/opt/mm_buddyTemplate.c b/src/opt/mm_buddyTemplate.c index 9a73902b..8b10368a 100644 --- a/src/opt/mm_buddyTemplate.c +++ b/src/opt/mm_buddyTemplate.c @@ -76,8 +76,8 @@ static NOINLINE void* BN(allocateMore)(ux bucket, u8 type, ux from, ux to) { if (ptr2u64(mem)+sz > (1ULL<<48)) fatal("mmap returned address range above 2⋆48"); #if ALLOC_MODE==0 mem+= ALLOC_PADDING; - // ux off = offsetof(TyArr,a); - // if (off&31) mem+= 32-(off&31); // align heap such that arr->a is 32-byte-aligned + ux off = offsetof(TyArr,a); + if (off&31) mem+= 32-(off&31); // align heap such that arr->a is 32-byte-aligned #endif EmptyValue* c = (void*)mem;