summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2015-12-05 19:15:19 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2015-12-05 19:15:25 +0100
commit5f1e42f22cf29bc1b7150e06b2711fa7c43c6e5b (patch)
tree2d19ac3d7d136bf8bbe314e93f8b21b7a9801cb2
parent13ab2c64a7e98bab391222dbd015ea3a4b91a9ed (diff)
downloadhaskell-5f1e42f22cf29bc1b7150e06b2711fa7c43c6e5b.tar.gz
Allow to compile OSMem.c when MEM_NORESERVE is not available
On some OSes such as AIX `MEM_NORESERVE` is not available. Since this feature is only needed when the new two-step allocator (see #9706) is enabled we can simply turn this into a runtime error to avoid a larger refactoring of this already quite platform-sensitive code. Reviewed By: bgamari, ezyang Differential Revision: https://phabricator.haskell.org/D1568
-rw-r--r--rts/posix/OSMem.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c
index 274d5ada73..60e684fa34 100644
--- a/rts/posix/OSMem.c
+++ b/rts/posix/OSMem.c
@@ -151,7 +151,14 @@ my_mmap (void *addr, W_ size, int operation)
else
prot = PROT_NONE;
if (operation == MEM_RESERVE)
+# if defined(MAP_NORESERVE)
flags = MAP_NORESERVE;
+# else
+# ifdef USE_LARGE_ADDRESS_SPACE
+# error USE_LARGE_ADDRESS_SPACE needs MAP_NORESERVE
+# endif
+ errorBelch("my_mmap(,,MEM_RESERVE) not supported on this platform");
+# endif
else if (operation == MEM_COMMIT)
flags = MAP_FIXED;
else