(&self)
| 102 | // Cold because it should only happen during first-time initialization. |
| 103 | #[cold] |
| 104 | unsafe fn initialize(&self) -> Option<F> { |
| 105 | let val = fetch(self.name); |
| 106 | // This synchronizes with the acquire fence in `get`. |
| 107 | self.addr.store(val, Ordering::Release); |
| 108 | |
| 109 | match val { |
| 110 | NULL => None, |
| 111 | addr => Some(mem::transmute_copy::<*mut c_void, F>(&addr)), |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | // To avoid having the `linux_raw` backend depend on the libc crate, just |