8 dtor: Option<unsafe extern fn(*mut u8)>,
12 pub unsafe fn create(dtor: Option<unsafe extern fn(*mut u8)>) -> Key {
13 Box::into_raw(Box::new(Allocated {
14 value: ptr::null_mut(),
20 pub unsafe fn set(key: Key, value: *mut u8) {
21 (*(key as *mut Allocated)).value = value;
25 pub unsafe fn get(key: Key) -> *mut u8 {
26 (*(key as *mut Allocated)).value
30 pub unsafe fn destroy(key: Key) {
31 let key = Box::from_raw(key as *mut Allocated);
32 if let Some(f) = key.dtor {
38 pub fn requires_synchronized_create() -> bool {