From d653cb6d95342aca8251a13af55a9cd61e58cebb Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Fri, 30 Jan 2026 10:46:18 +0800 Subject: [PATCH] fix --- lib/system/alloc.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index ac5eaae263..ffadbde27c 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -964,7 +964,7 @@ proc rawAlloc(a: var MemRegion, requestedSize: int, alignment: int = MemAlign, e result = addr(c.data) # Apply alignment if needed: align (result + extraSize) to alignment boundary - if alignment > MemAlign and extraSize > 0: + if alignment > MemAlign: let mask = alignment - 1 let alignedUserData = (cast[int](result) + extraSize + mask) and not mask result = cast[pointer](alignedUserData - extraSize)