This commit is contained in:
ringabout
2026-03-03 16:21:49 +08:00
parent 9ed4077d9a
commit 18a9bff490
3 changed files with 18 additions and 15 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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: