2019-04-05 14:19:10 +00:00
|
|
|
// Work around https://github.com/gnzlbg/jemallocator/issues/19
|
2017-10-30 13:03:13 +00:00
|
|
|
#[global_allocator]
|
2020-07-21 11:33:59 +00:00
|
|
|
static A: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
|
2017-10-30 13:03:13 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn smoke() {
|
|
|
|
unsafe {
|
2020-07-21 11:33:59 +00:00
|
|
|
let ptr = tikv_jemalloc_sys::malloc(4);
|
2017-10-30 13:03:13 +00:00
|
|
|
*(ptr as *mut u32) = 0xDECADE;
|
|
|
|
assert_eq!(*(ptr as *mut u32), 0xDECADE);
|
2020-07-21 11:33:59 +00:00
|
|
|
tikv_jemalloc_sys::free(ptr);
|
2017-10-30 13:03:13 +00:00
|
|
|
}
|
|
|
|
}
|