[commit: ghc] master: Allow to compile OSMem.c when MEM_NORESERVE is not available (5f1e42f)

git at git.haskell.org git at git.haskell.org
Sat Dec 5 18:15:41 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5f1e42f22cf29bc1b7150e06b2711fa7c43c6e5b/ghc

>---------------------------------------------------------------

commit 5f1e42f22cf29bc1b7150e06b2711fa7c43c6e5b
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Dec 5 19:15:19 2015 +0100

    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


>---------------------------------------------------------------

5f1e42f22cf29bc1b7150e06b2711fa7c43c6e5b
 rts/posix/OSMem.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c
index 274d5ad..60e684f 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



More information about the ghc-commits mailing list