jemallocator 0.5.4

A Rust allocator backed by jemalloc
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// Work around https://github.com/gnzlbg/jemallocator/issues/19
#[global_allocator]
static A: jemallocator::Jemalloc = jemallocator::Jemalloc;

#[test]
fn smoke() {
    unsafe {
        let ptr = jemalloc_sys::malloc(4);
        *(ptr as *mut u32) = 0xDECADE;
        assert_eq!(*(ptr as *mut u32), 0xDECADE);
        jemalloc_sys::free(ptr);
    }
}