summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2018-07-06 11:11:20 -0400
committerBen Gamari <ben@smart-cactus.org>2018-07-06 14:08:37 -0400
commit8736715857d08cc1f88d766c257b39c05df20639 (patch)
tree88d687c08c55aa0bc4a684536d5e32554a5c02ef /configure.ac
parentf03f0d61bebe287e0df0254c175eb2f183d697aa (diff)
downloadhaskell-8736715857d08cc1f88d766c257b39c05df20639.tar.gz
rts: Enable two-step allocator on FreeBSD
Previously we would prevent any operating system not providing the MEM_NORESERVE flag from using the two-step allocator. Afterall, Linux will reserve swap-space for a mapping unless this flag is given, which is most certainly not what we want. However, it seems that FreeBSD provides the reservation-only mapping behavior that we expect despite not providing the MEM_NORESERVE macro. In fact, it provided the macro until 2014, when it was removed on account of not being implemented in the kernel. However, empirical evidence suggests that just plain mmap does what we want. Reviewers: erikd, simonmar Subscribers: rwbarton, thomie, erikd, carter GHC Trac Issues: #15348 Differential Revision: https://phabricator.haskell.org/D4939
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 9 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index ac464b6d2f..1976530df9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1182,22 +1182,23 @@ if test "$ac_cv_sizeof_void_p" -eq 8 ; then
if test "x$EnableLargeAddressSpace" = "xyes" ; then
if test "$ghc_host_os" = "darwin" ; then
use_large_address_space=yes
- elif test "$ghc_host_os" = "openbsd" ; then
- # as of OpenBSD 5.8 (2015), OpenBSD does not support mmap with MAP_NORESERVE.
- # The flag MAP_NORESERVE is supported for source compatibility reasons,
- # but is completely ignored by OS mmap
+ elif test "$ghc_host_os" = "openbsd" ; then
+ # as of OpenBSD 5.8 (2015), OpenBSD does not support mmap with MAP_NORESERVE.
+ # The flag MAP_NORESERVE is supported for source compatibility reasons,
+ # but is completely ignored by OS mmap
use_large_address_space=no
else
- AC_CHECK_DECLS([MAP_NORESERVE, MADV_FREE, MADV_DONTNEED],[],[],
+ AC_CHECK_DECLS([MAP_NORESERVE, MAP_GUARD, 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
+ if ( test "$ac_cv_have_decl_MAP_NORESERVE" = "yes" ||
+ test "$ac_cv_have_decl_MAP_GUARD" = "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