Skip to content
  • Mike Hommey's avatar
    Bug 1356701 - Export unprefixed malloc and duplication functions on OSX. r=njn · 19448fe7
    Mike Hommey authored
    Going through the system zone allocator for every call to realloc/free
    on OSX is costly, because the zone allocator needs to first verify that
    the allocations do belong to the allocator it invokes (which ends up
    calling jemalloc's malloc_usable_size), which is unnecessary when we
    expect the allocations to belong to jemalloc.
    
    So, we export the malloc/realloc/free/etc. symbols from
    libmozglue.dylib, such that libraries and programs linked against it
    call directly into jemalloc instead of going through the system zone
    allocator, effectively shortcutting the allocator verification.
    
    The risk is that some things in Gecko try to realloc/free pointers it
    got from system libraries, if those were allocated with a system zone
    that is not jemalloc.
    
    --HG--
    extra : rebase_source : ee0b29e1275176f52e64f4648dfa7ce25d61292e
    19448fe7