diff options
author | Dmitry Atamanov <data-man@users.noreply.github.com> | 2018-01-08 23:26:03 +0300 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-01-08 21:26:03 +0100 |
commit | fd1883f90aecd15a3d9596c5fc45bac49b431b4b (patch) | |
tree | dea35adab44f798c90ac4fb00ae940a4c6720470 /lib/core/allocators.nim | |
parent | e2f1f8bafa2c21b19875b3a75392c9a77ecade0b (diff) | |
download | Nim-fd1883f90aecd15a3d9596c5fc45bac49b431b4b.tar.gz |
Fixes for new runtime (#7037)
Diffstat (limited to 'lib/core/allocators.nim')
-rw-r--r-- | lib/core/allocators.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/core/allocators.nim b/lib/core/allocators.nim index d6608a203..4edd00f36 100644 --- a/lib/core/allocators.nim +++ b/lib/core/allocators.nim @@ -9,7 +9,7 @@ type Allocator* {.inheritable.} = ptr object - alloc*: proc (a: Allocator; size: int; alignment = 8): pointer {.nimcall.} + alloc*: proc (a: Allocator; size: int; alignment: int = 8): pointer {.nimcall.} dealloc*: proc (a: Allocator; p: pointer; size: int) {.nimcall.} realloc*: proc (a: Allocator; p: pointer; oldSize, newSize: int): pointer {.nimcall.} @@ -22,14 +22,14 @@ proc getCurrentAllocator*(): Allocator = proc setCurrentAllocator*(a: Allocator) = currentAllocator = a -proc alloc*(size: int): pointer = +proc alloc*(size: int; alignment: int = 8): pointer = let a = getCurrentAllocator() - result = a.alloc(a, size) + result = a.alloc(a, size, alignment) proc dealloc*(p: pointer; size: int) = let a = getCurrentAllocator() - a.dealloc(a, size) + a.dealloc(a, p, size) proc realloc*(p: pointer; oldSize, newSize: int): pointer = let a = getCurrentAllocator() - result = a.realloc(a, oldSize, newSize) + result = a.realloc(a, p, oldSize, newSize) |