#![deny(unsafe_op_in_unsafe_fn)]
use core::sync::atomic::AtomicUsize;
const _: () = assert!(size_of::<usize>() >= size_of::<u64>());
pub mod error;
pub mod mpmc;
mod shmem;
pub mod spsc;
pub(crate) const VERSION_MAJOR: u16 = 2;
pub(crate) const VERSION_PATCH: u16 = 0;
pub(crate) const VERSION: u32 = (VERSION_MAJOR as u32) << 16 | VERSION_PATCH as u32;
pub(crate) const fn normalized_capacity(capacity: usize) -> usize {
if capacity == 0 {
0
} else {
capacity.next_power_of_two()
}
}
#[derive(Default)]
#[repr(C, align(64))]
struct CacheAlignedAtomicSize {
inner: AtomicUsize,
}
impl core::ops::Deref for CacheAlignedAtomicSize {
type Target = AtomicUsize;
fn deref(&self) -> &Self::Target {
&self.inner
}
}