#[repr(C, align(64))]pub struct KhlHeader {
pub magic: u64,
pub capacity: u64,
pub owner_pid: AtomicU64,
pub epoch: AtomicU64,
pub _pad_meta: [u8; 24],
pub tail: AtomicI64,
pub _pad_tail: [u8; 56],
pub head: AtomicI64,
pub _pad_head: [u8; 56],
}Expand description
File header. Cache-line aligned. head and tail each get their
own cache line so the producer’s owner-private store on tail
does not invalidate the consumer-side head line.
Fields§
§magic: u64Magic constant.
capacity: u64Number of ring slots; always a power of two.
owner_pid: AtomicU64Pid of the owner process; informational. Cleared on
close_owner().
epoch: AtomicU64Epoch counter advanced by the owner on shutdown.
_pad_meta: [u8; 24]Padding to push tail to its own cache line.
tail: AtomicI64Producer counter. Written by the owner only (Chase-Lev-style owner-private counter); Release-stored after the per-slot publish loop. Thieves Acquire-load to learn the high watermark.
_pad_tail: [u8; 56]Padding to push head to its own cache line.
head: AtomicI64Consumer counter. Thieves CAS to claim a slot.
_pad_head: [u8; 56]Padding round to two whole cache lines after head.
Auto Trait Implementations§
impl !Freeze for KhlHeader
impl RefUnwindSafe for KhlHeader
impl Send for KhlHeader
impl Sync for KhlHeader
impl Unpin for KhlHeader
impl UnsafeUnpin for KhlHeader
impl UnwindSafe for KhlHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more