Skip to content
  • Ben Gamari's avatar
    rts: Make m32 allocator per-ObjectCode · c6759080
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    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
    executable).
    
    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).
    c6759080