forward type alignment information to seqs (#12430)
This commit is contained in:
parent
a8f030fea2
commit
4005f0d0e4
25 changed files with 152 additions and 114 deletions
|
|
@ -45,7 +45,6 @@ type
|
|||
data: TrunkBuckets
|
||||
|
||||
type
|
||||
AlignType = BiggestFloat
|
||||
FreeCell {.final, pure.} = object
|
||||
next: ptr FreeCell # next free cell in chunk (overlaid with refcount)
|
||||
when not defined(gcDestructors):
|
||||
|
|
@ -68,16 +67,20 @@ type
|
|||
freeList: ptr FreeCell
|
||||
free: int # how many bytes remain
|
||||
acc: int # accumulator for small object allocation
|
||||
when defined(cpu32):
|
||||
align: int
|
||||
data: AlignType # start of usable memory
|
||||
when defined(nimAlignPragma):
|
||||
data {.align: MemAlign.}: UncheckedArray[byte] # start of usable memory
|
||||
else:
|
||||
data: UncheckedArray[byte]
|
||||
|
||||
BigChunk = object of BaseChunk # not necessarily > PageSize!
|
||||
next, prev: PBigChunk # chunks of the same (or bigger) size
|
||||
data: AlignType # start of usable memory
|
||||
when defined(nimAlignPragma):
|
||||
data {.align: MemAlign.}: UncheckedArray[byte] # start of usable memory
|
||||
else:
|
||||
data: UncheckedArray[byte]
|
||||
|
||||
template smallChunkOverhead(): untyped = sizeof(SmallChunk)-sizeof(AlignType)
|
||||
template bigChunkOverhead(): untyped = sizeof(BigChunk)-sizeof(AlignType)
|
||||
template smallChunkOverhead(): untyped = sizeof(SmallChunk)
|
||||
template bigChunkOverhead(): untyped = sizeof(BigChunk)
|
||||
|
||||
# ------------- chunk table ---------------------------------------------------
|
||||
# We use a PtrSet of chunk starts and a table[Page, chunksize] for chunk
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue