From 9c7f2cfad4e47495575f84c4ef4afe70345574e3 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Mon, 2 Feb 2026 16:59:55 +0800 Subject: [PATCH] minor --- 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 53c5770bb2..63f96a23da 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -850,9 +850,9 @@ proc applyAlignment(basePtr: pointer, alignment: int, offset: int, c: PBigChunk) # Apply alignment if needed: align (basePtr + offset) to alignment boundary if alignment > MemAlign: let base = basePtr +! offset - let alignOffset = alignment - (cast[int](base) and (alignment - 1)) + let alignOffset = alignment -% cast[int](cast[uint](base) and uint(alignment - 1)) result = base +! alignOffset - c.alignOffset = cast[uint16](alignOffset + offset) + c.alignOffset = cast[uint16](alignOffset +% offset) else: c.alignOffset = 0 result = basePtr