[commit: ghc] master: configure.ac: Allow disabling of large-address-space (fba724c)
git at git.haskell.org
git at git.haskell.org
Tue Aug 25 22:21:54 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/fba724ccabd295fc37e71ba6c4f892822a831d19/ghc
>---------------------------------------------------------------
commit fba724ccabd295fc37e71ba6c4f892822a831d19
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date: Tue Aug 25 11:33:32 2015 +1000
configure.ac: Allow disabling of large-address-space
Recent changes (commit 0d1a8d09f4) for 64 bit platforms allowed GHC
to mmap one huge (currently 1 terrabyte) memory region from which to
do its own allocations. This is enabled by default, but it would be
nice (even just from the point of view of testing) to be able to
disable this at configure time.
Test Plan: configure and grep mk/config.h for USE_LARGE_ADDRESS_SPACE
Reviewers: austin, ezyang, bgamari, rwbarton
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1170
GHC Trac Issues: #10791
>---------------------------------------------------------------
fba724ccabd295fc37e71ba6c4f892822a831d19
configure.ac | 42 ++++++++++++++++++++++++++----------------
1 file changed, 26 insertions(+), 16 deletions(-)
diff --git a/configure.ac b/configure.ac
index e7f9144..793ec0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1066,24 +1066,34 @@ dnl runs out of paging file when we have multiple processes reserving
dnl 1TB of address space, we get the following error:
dnl VirtualAlloc MEM_RESERVE 1099512676352 bytes failed: The paging file is too small for this operation to complete.
dnl
+
+AC_ARG_ENABLE(large-address-space,
+ [AC_HELP_STRING([--enable-large-address-space],
+ [Use a single large address space on 64 bit systems (enabled by default on 64 bit platforms)])],
+ EnableLargeAddressSpace=$enableval,
+ EnableLargeAddressSpace=yes
+)
+
use_large_address_space=no
if test "$ac_cv_sizeof_void_p" -eq 8 ; then
- if test "$ghc_host_os" = "darwin" ; then
- use_large_address_space=yes
- else
- AC_CHECK_DECLS([MAP_NORESERVE, MADV_FREE, MADV_DONTNEED],[],[],
-[
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-])
- if test "$ac_cv_have_decl_MAP_NORESERVE" = "yes" &&
- test "$ac_cv_have_decl_MADV_FREE" = "yes" ||
- test "$ac_cv_have_decl_MADV_DONTNEED" = "yes" ; then
- use_large_address_space=yes
- fi
- fi
+ if test "x$EnableLargeAddressSpace" = "xyes" ; then
+ if test "$ghc_host_os" = "darwin" ; then
+ use_large_address_space=yes
+ else
+ AC_CHECK_DECLS([MAP_NORESERVE, MADV_FREE, MADV_DONTNEED],[],[],
+ [
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/mman.h>
+ #include <fcntl.h>
+ ])
+ if test "$ac_cv_have_decl_MAP_NORESERVE" = "yes" &&
+ test "$ac_cv_have_decl_MADV_FREE" = "yes" ||
+ test "$ac_cv_have_decl_MADV_DONTNEED" = "yes" ; then
+ use_large_address_space=yes
+ fi
+ fi
+ fi
fi
if test "$use_large_address_space" = "yes" ; then
AC_DEFINE([USE_LARGE_ADDRESS_SPACE], [1], [Enable single heap address space support])
More information about the ghc-commits
mailing list