diff options
author | Jacek Sieka <arnetheduck@gmail.com> | 2016-03-07 22:02:24 +0800 |
---|---|---|
committer | Jacek Sieka <arnetheduck@gmail.com> | 2016-03-07 22:02:24 +0800 |
commit | 87a8bc6557125f5566536d6f0825ed975e616439 (patch) | |
tree | cc44874a09fd65651ce38a91a093a1b38e9e781d /lib/system | |
parent | e4e8ebd4a50bc86b0b08df449d5ff72e365a4c6a (diff) | |
download | Nim-87a8bc6557125f5566536d6f0825ed975e616439.tar.gz |
fix return type of munmap
Diffstat (limited to 'lib/system')
-rw-r--r-- | lib/system/alloc.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index 67d380391..ff3e42fa1 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -49,7 +49,7 @@ when defined(emscripten): proc mmap(adr: pointer, len: int, prot, flags, fildes: cint, off: int): pointer {.header: "<sys/mman.h>".} - proc munmap(adr: pointer, len: int) {.header: "<sys/mman.h>".} + proc munmap(adr: pointer, len: int): cint {.header: "<sys/mman.h>".} proc osAllocPages(block_size: int): pointer {.inline.} = let realSize = block_size + sizeof(EmscriptenMMapBlock) + PageSize + 1 @@ -78,7 +78,7 @@ when defined(emscripten): proc osDeallocPages(p: pointer, size: int) {.inline} = var mmapDescrPos = cast[ByteAddress](p) -% sizeof(EmscriptenMMapBlock) var mmapDescr = cast[EmscriptenMMapBlock](mmapDescrPos) - munmap(mmapDescr.realPointer, mmapDescr.realSize) + discard munmap(mmapDescr.realPointer, mmapDescr.realSize) elif defined(posix): const @@ -97,7 +97,7 @@ elif defined(posix): proc mmap(adr: pointer, len: int, prot, flags, fildes: cint, off: int): pointer {.header: "<sys/mman.h>".} - proc munmap(adr: pointer, len: int) {.header: "<sys/mman.h>".} + proc munmap(adr: pointer, len: int): cint {.header: "<sys/mman.h>".} proc osAllocPages(size: int): pointer {.inline.} = result = mmap(nil, size, PROT_READ or PROT_WRITE, @@ -106,7 +106,7 @@ elif defined(posix): raiseOutOfMem() proc osDeallocPages(p: pointer, size: int) {.inline} = - when reallyOsDealloc: munmap(p, size) + when reallyOsDealloc: discard munmap(p, size) elif defined(windows): const |