Closed
Description
It would be nice if it was possible to use an alternate global allocator without recompiling all of Rust. This would make it painless to swap in a build of jemalloc with assertions enabled which is a very useful debugging tool. It would also mean that the default liballoc could use a build of jemalloc without niche frills like heap profiling and zero/junk filling without forcing a recompile to use them.
If and when jemalloc gains support for sized deallocation in the reallocation APIs (either upstream or in Rust's fork), a sane implementation of the non-standard API could be done via the platform allocator API. This would make it possible to choose between jemalloc and the platform allocator without recompiling Rust.