rts: Enable two-step allocator on FreeBSD
ClosedPublic

Authored by bgamari on Thu, Jul 5, 9:32 PM.

Details

Summary

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.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bgamari created this revision.Thu, Jul 5, 9:32 PM
bgamari updated this revision to Diff 17215.Fri, Jul 6, 10:16 AM

Use MAP_GUARD

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Jul 6, 1:35 PM
This revision was automatically updated to reflect the committed changes.