Commit 5f1e42f2 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

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
parent 13ab2c64
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment