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 } static mut GITERATED_TYPE_METADATA: MaybeUninit = MaybeUninit::zeroed(); pub unsafe fn initialize_type_metadata(runtime_pointer: *mut ()) { GITERATED_TYPE_METADATA.write(RuntimePointer(NonNull::new(runtime_pointer).unwrap())); } pub unsafe fn get_type_metadata_reference() -> NonNull<()> { GITERATED_TYPE_METADATA.assume_init_read().0 }