rust-lang/rust — pull request #17205 by thestinger (2014-09-12 18:43:23+00:00)
Title: stop adding a jemalloc prefix on Linux

The prefix was added for all operating systems to avoid issues on OS X
and Windows. However, it does work properly on Linux with the defaults.

This will make it possible to use the jemalloc provided by distributions
after the next release with `sdallocx`. 8c057984 can then be reverted
once Travis has a recent enough jemalloc available.

Avoiding the prefix allows jemalloc to override the weak symbols from
libc and the malloc hooks. This eliminates the external fragmentation
caused by having two general purpose allocators in the same process.

The time spent on LLVM passes in the Rust compiler is cut by 10-15%, and
peak memory usage is reduced by 8-20%.

In the future, this can be extended to other operating systems but it
will require lots of testing, and may involve carefully ordering the
libraries the linker is asked to include so that jemalloc is included
before the C standard library.