alexcrichton · GitHub

Tracking issue for rust-lang/rfcs#1183 rust-lang/rfcs#1974

Known bugs:

Current status:

A quick summary of the current state of this feature is that you can change the default global allocator via:

// Change this program's global allocator. At most one `#[global_allocator]` 
// allowed in any crate graph.
#[global_allocator]
static ALLOCATOR: MyAlloc = MyAlloc;
// When defining a global allocator, the `Alloc` trait must be defined
// for `&'a T` instead of `T`
use std::heap::Alloc;
struct MyAlloc;
impl<'a> Alloc for &'a MyAlloc {
    // ...
}

Read the original on github.com ↗