From decd9b3e63824839103732e662d4304f7a343b6e Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Mon, 16 Feb 2026 18:14:38 +0800 Subject: [PATCH] test --- 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 e6c015dbee..bb65c3c22a 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)