mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-11 22:08:54 +00:00
fixes https://github.com/nim-lang/Nim/issues/25457 Small chunks allocate memory in fixed-size cells. Each cell is positioned at exact multiples of the cell size from the chunk's data start, which makes it much harder to support alignment ```nim sysAssert c.size == size, "rawAlloc 6" if c.freeList == nil: sysAssert(c.acc.int + smallChunkOverhead() + size <= SmallChunkSize, "rawAlloc 7") result = cast[pointer](cast[int](addr(c.data)) +% c.acc.int) inc(c.acc, size) ``` See also https://github.com/nim-lang/Nim/pull/12926 While using big trunk, each allocation gets its own chunk