diff options
author | Araq <rumpf_a@web.de> | 2011-12-31 15:49:48 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-12-31 15:49:48 +0100 |
commit | 4d9e8e13ae35452f66dfcb89e1692762660deaac (patch) | |
tree | cababbcc6b8554beba77419cde4aed76319636b8 /lib | |
parent | f30eb9feb8430587d285d863f4f906d8874b8d73 (diff) | |
download | Nim-4d9e8e13ae35452f66dfcb89e1692762660deaac.tar.gz |
MAP_ANONYMOUS is not always 0x20 for linux; changed the tests
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/system/alloc.nim | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index bc8124aca..e31ef47df 100755 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -20,15 +20,14 @@ when defined(posix): PROT_WRITE = 2 # page can be written MAP_PRIVATE = 2 # Changes are private - when defined(linux) or defined(aix): - const MAP_ANONYMOUS = 0x20 # don't use a file - elif defined(macosx) or defined(bsd): + when defined(macosx) or defined(bsd): const MAP_ANONYMOUS = 0x1000 elif defined(solaris): const MAP_ANONYMOUS = 0x100 else: - {.error: "Port memory manager to your platform".} - + var + MAP_ANONYMOUS {.importc: "MAP_ANONYMOUS", header: "<sys/mman.h>".}: cint + proc mmap(adr: pointer, len: int, prot, flags, fildes: cint, off: int): pointer {.header: "<sys/mman.h>".} |