diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index 1c2706120e..77025265f1 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -104,6 +104,8 @@ type zeroField: int # 0 means cell is not used (overlaid with typ field) # 1 means cell is manually managed pointer # otherwise a PNimType is stored in there + when sizeof(int) == 4: # 32-bit only + headerAlignPad: array[8, byte] # so addr(data) ≡ 8 (mod 16) else: alignment: int diff --git a/lib/system/cellsets.nim b/lib/system/cellsets.nim index 80f0367019..07bf440753 100644 --- a/lib/system/cellsets.nim +++ b/lib/system/cellsets.nim @@ -48,7 +48,23 @@ when defined(gcOrc) or defined(gcArc) or defined(gcAtomicArc) or defined(gcYrc): when not declaredInScope(PageShift): include bitmasks +else: + type + RefCount = int + Cell {.pure.} = object + refcount: RefCount # the refcount and some flags + typ: PNimType + + when trackAllocationSource: + filename: cstring + line: int + elif useCellIds: + id: int + elif defined(cpu32): + headerAlignPad: array[8, byte] # so addr(data) ≡ 8 (mod 16) + + PCell = ptr Cell type PPageDesc = ptr PageDesc diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim index ce935ff8af..7fd61e0dc3 100644 --- a/lib/system/mmdisp.nim +++ b/lib/system/mmdisp.nim @@ -38,21 +38,6 @@ type PByte = ptr ByteArray PString = ptr string -when not defined(nimV2): - type - RefCount = int - - Cell {.pure.} = object - refcount: RefCount # the refcount and some flags - typ: PNimType - when trackAllocationSource: - filename: cstring - line: int - when useCellIds: - id: int - - PCell = ptr Cell - when declared(IntsPerTrunk): discard else: