rts: Make m32 allocator per-ObjectCode

Authored by bgamari on Mon, Oct 28, 12:37 PM.


rts: Make m32 allocator per-ObjectCode

MacOS Catalina is finally going to force our hand in forbidden writable
exeutable mappings. Unfortunately, this is quite incompatible with the
current global m32 allocator, which mixes symbols from various objects
in a single page. The problem here is that some of these symbols may not
yet be resolved (e.g. had relocations performed) as this happens lazily
(and therefore we can't yet make the section read-only and therefore

The easiest way around this is to simply create one m32 allocator per
ObjectCode. This may slightly increase fragmentation for short-running
programs but I suspect will actually improve fragmentation for programs
doing lots of loading/unloading since we can always free all of the
pages allocated to an object when it is unloaded (although this ability
will only be implemented in a later patch).


Marge Bot <ben+marge-bot@smart-cactus.org>Fri, Nov 1, 3:55 AM
rGHC70b62c97622f: mmap: Factor out protection flags
Marge Bot <ben+marge-bot@smart-cactus.org> committed rGHCc6759080a918: rts: Make m32 allocator per-ObjectCode (authored by bgamari).Fri, Nov 1, 3:55 AM