rts: Enable two-step allocator on FreeBSD
authorBen Gamari <bgamari.foss@gmail.com>
Fri, 6 Jul 2018 15:11:20 +0000 (11:11 -0400)
committerBen Gamari <ben@smart-cactus.org>
Fri, 6 Jul 2018 18:08:37 +0000 (14:08 -0400)
commit8736715857d08cc1f88d766c257b39c05df20639
tree88d687c08c55aa0bc4a684536d5e32554a5c02ef
parentf03f0d61bebe287e0df0254c175eb2f183d697aa
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
configure.ac
rts/posix/OSMem.c