use std::{mem::MaybeUninit, ptr::NonNull}; struct RuntimePointer(NonNull<()>); unsafe impl Send for RuntimePointer {} unsafe impl Sync for RuntimePointer {} static mut GITERATED_RUNTIME: MaybeUninit = MaybeUninit::zeroed(); pub unsafe fn initialize_runtime(runtime_pointer: *mut ()) { GITERATED_RUNTIME.write(RuntimePointer(NonNull::new(runtime_pointer).unwrap())); } pub unsafe fn get_runtime_reference() -> NonNull<()> { GITERATED_RUNTIME.assume_init_read().0 }