summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2015-08-25 11:33:32 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2015-08-26 06:54:05 +1000
commitfba724ccabd295fc37e71ba6c4f892822a831d19 (patch)
tree4787a509c935ba6e64ef6436e405496de2fcf0ad
parentb78494eee787bdc0f9cc263b773638dc7db3482f (diff)
downloadhaskell-fba724ccabd295fc37e71ba6c4f892822a831d19.tar.gz
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
-rw-r--r--configure.ac42
1 files changed, 26 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index e7f91444fa..793ec0f61b 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])