2018-10-24 12:34:48 +00:00
|
|
|
extern crate jemalloc_sys;
|
|
|
|
extern crate libc;
|
|
|
|
|
|
|
|
union U {
|
|
|
|
x: &'static u8,
|
2018-10-30 19:34:36 +00:00
|
|
|
y: &'static libc::c_char,
|
2018-10-24 12:34:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(non_upper_case_globals)]
|
|
|
|
#[cfg_attr(prefixed, export_name = "_rjem_malloc_conf")]
|
|
|
|
#[cfg_attr(not(prefixed), no_mangle)]
|
2018-10-30 19:34:36 +00:00
|
|
|
pub static malloc_conf: Option<&'static libc::c_char> = Some(unsafe {
|
|
|
|
U {
|
|
|
|
x: &b"abort:true\0"[0],
|
|
|
|
}
|
|
|
|
.y
|
|
|
|
});
|
2018-10-24 12:34:48 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn malloc_conf_set() {
|
|
|
|
unsafe {
|
|
|
|
assert_eq!(jemalloc_sys::malloc_conf, malloc_conf);
|
|
|
|
}
|
|
|
|
}
|