mirror of
https://git.proxmox.com/git/rustc
synced 2025-05-29 09:22:35 +00:00
14 lines
331 B
Rust
14 lines
331 B
Rust
use std::sync::atomic::{AtomicPtr, Ordering};
|
|
|
|
#[inline(always)]
|
|
pub fn memrchr() {
|
|
fn detect() {}
|
|
|
|
static CROSS_CRATE_STATIC_ITEM: AtomicPtr<()> = AtomicPtr::new(detect as *mut ());
|
|
|
|
unsafe {
|
|
let fun = CROSS_CRATE_STATIC_ITEM.load(Ordering::SeqCst);
|
|
std::mem::transmute::<*mut (), fn()>(fun)()
|
|
}
|
|
}
|