MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / initialize

Method initialize

src/weak.rs:104–113  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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

Callers 1

getMethod · 0.45

Calls 1

fetchFunction · 0.70

Tested by

no test coverage detected