[GHC] #15348: Enable two-step allocator on FreeBSD

GHC ghc-devs at haskell.org
Fri Jul 6 05:39:59 UTC 2018


#15348: Enable two-step allocator on FreeBSD
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  (none)
            Type:  feature request   |               Status:  patch
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:
Operating System:  FreeBSD           |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4939
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by vdukhovni):

 Specifically, one can reserve a contiguous address range with:
 {{{
 heap = mmap(NULL, heapmax, PROT_NONE, MAP_GUARD, -1, 0);
 }}}
 and then incrementally populate segments of that range:
 {{{
 mmap(base, len, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE|MAP_FIXED, -1,
 0);
 }}}
 With `base == heap` for the initial block of pages, and then to the first
 address not yet mapped for subsequent increments.
 What we don't get is protection from overcommit OOM, unless the system is
 configured to disallow overcommit.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15348#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list