From ac131313bcf238b44b65ad56198f870237e40b2b Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Mon, 16 Feb 2026 19:09:36 +0800 Subject: [PATCH] revert --- lib/system/alloc.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index bb65c3c22a..e6c015dbee 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -854,7 +854,7 @@ proc bigChunkAlignOffset(alignment: int): int {.inline.} = if alignment <= MemAlign: result = 0 else: - result = align(sizeof(BigChunk) + sizeof(Cell), alignment) -% sizeof(BigChunk) -% sizeof(Cell) + result = align(sizeof(BigChunk) + sizeof(Cell), alignment) - sizeof(BigChunk) - sizeof(Cell) proc rawAlloc(a: var MemRegion, requestedSize: int, alignment: int = MemAlign): pointer = when defined(nimTypeNames): @@ -967,7 +967,7 @@ proc rawAlloc(a: var MemRegion, requestedSize: int, alignment: int = MemAlign): # Since chunks are page-aligned, the needed padding is a compile-time # deterministic value rather than a worst-case estimate. let alignPad = bigChunkAlignOffset(alignment) - size = requestedSize +% bigChunkOverhead() +% alignPad + size = requestedSize + bigChunkOverhead() + alignPad # allocate a large block var c = if size >= HugeChunkSize: getHugeChunk(a, size) else: getBigChunk(a, size)