diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/system/alloc.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index 82755ca86..d6093c5b1 100755 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -729,7 +729,8 @@ template InstantiateForRegion(allocator: expr) = proc interiorAllocatedPtr*(p: pointer): pointer = result = interiorAllocatedPtr(allocator, p) - proc isAllocatedPtr*(p: pointer): bool = + proc isAllocatedPtr*(p: pointer): bool = + let p = cast[pointer](cast[TAddress](p)-%TAddress(sizeof(TCell))) result = isAllocatedPtr(allocator, p) proc deallocOsPages = deallocOsPages(allocator) |