padding Cell

This commit is contained in:
ringabout
2026-03-02 21:36:57 +08:00
parent e5d06caa87
commit dc8b413055
2 changed files with 4 additions and 4 deletions

View File

@@ -24,9 +24,6 @@ const
elif defined(useMalloc):
when defined(amd64): 16
else: 8
elif defined(gcRefc):
when defined(i386): 8
else: 16
else: 16
BitsPerPage = PageSize div MemAlign

View File

@@ -45,6 +45,9 @@ when not defined(nimV2):
Cell {.pure.} = object
refcount: RefCount # the refcount and some flags
typ: PNimType
when sizeof(int) == 4: # 32-bit only
headerAlignPad: array[8, byte] # so addr(data) ≡ 8 (mod 16)
when trackAllocationSource:
filename: cstring
line: int
@@ -93,7 +96,7 @@ else:
when not usesDestructors:
include "system/cellsets"
when not leakDetector and not useCellIds and not defined(nimV2):
sysAssert(sizeof(Cell) == sizeof(FreeCell), "sizeof FreeCell")
sysAssert(sizeof(FreeCell) <= sizeof(Cell), "sizeof FreeCell")
when defined(gcRegions):
# XXX due to bootstrapping reasons, we cannot use compileOption("gc", "stack") here
include "system/gc_regions"