mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-18 12:52:42 +00:00
fix
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user