Skip to main content

wowlab_engine_domain/rotation/
jit_common.rs

1//! Shared types for the LLVM JIT.
2
3use static_assertions::assert_impl_all;
4
5pub(crate) type RotationFn = unsafe extern "C" fn(*mut u8, f64) -> u64;
6
7#[derive(Clone, Copy)]
8pub(crate) struct SyncFnPtr(pub(crate) RotationFn);
9
10// SAFETY: JIT-compiled code is immutable and stateless.
11unsafe impl Send for SyncFnPtr {}
12// SAFETY: JIT-compiled code is immutable and stateless.
13unsafe impl Sync for SyncFnPtr {}
14
15assert_impl_all!(SyncFnPtr: Send, Sync);