From e5d06caa875b5ea89d4de2adee0815d477fba198 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Mon, 2 Mar 2026 19:39:02 +0800 Subject: [PATCH] check --- lib/system/gc.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 9039de7d6b..8cc9c63878 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -460,7 +460,7 @@ proc rawNewObj(typ: PNimType, size: int, gch: var GcHeap): pointer = collectCT(gch) # Use alignment from typ.base if available, otherwise use MemAlign let alignment = if typ.kind == tyRef and typ.base != nil and - typ.base.align > MemAlign: typ.base.align else: 0 + typ.base.align > 16: typ.base.align else: 0 var res = cast[PCell](rawAlloc(gch.region, size + sizeof(Cell), alignment)) #gcAssert typ.kind in {tyString, tySequence} or size >= typ.base.size, "size too small" # Check that the user data (after the Cell header) is properly aligned @@ -517,7 +517,7 @@ proc newObjRC1(typ: PNimType, size: int): pointer {.compilerRtl, noinline, raise # Use alignment from typ.base if available, otherwise use MemAlign let alignment = if typ.kind == tyRef and typ.base != nil and - typ.base.align > MemAlign: typ.base.align else: 0 + typ.base.align > 16: typ.base.align else: 0 var res = cast[PCell](rawAlloc(gch.region, size + sizeof(Cell), alignment)) sysAssert(allocInv(gch.region), "newObjRC1 after rawAlloc") # Check that the user data (after the Cell header) is properly aligned