jemallocator 0.1.9

A Rust allocator backed by jemalloc
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate jemallocator;
extern crate jemalloc_sys;

// Work around https://github.com/alexcrichton/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);
    }
}