diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 8cc9c63878..9039de7d6b 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 > 16: typ.base.align else: 0 + typ.base.align > MemAlign: 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 > 16: typ.base.align else: 0 + typ.base.align > MemAlign: 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