#[repr(C)]pub struct VarSlotMeta {
pub generation: AtomicU32,
pub state: AtomicU32,
pub owner_peer: AtomicU32,
pub next_free: AtomicU32,
}Expand description
Metadata for a variable-size slot with ownership tracking.
Used by shared variable-size slot pools where we need to track which peer allocated each slot for crash recovery.
shm[impl shm.varslot.ownership]
Fields§
§generation: AtomicU32ABA counter, incremented on allocation.
state: AtomicU32Slot state: Free=0, Allocated=1, InFlight=2.
owner_peer: AtomicU32Peer ID that allocated this slot (0 = host, 1-255 = guest). Used for crash recovery: when a peer dies, its slots are reclaimed.
next_free: AtomicU32Free list link (next free slot index, or u32::MAX for end).
Implementations§
Source§impl VarSlotMeta
impl VarSlotMeta
Sourcepub fn generation(&self) -> u32
pub fn generation(&self) -> u32
Read the current generation.
Sourcepub fn check_generation(&self, expected: u32) -> bool
pub fn check_generation(&self, expected: u32) -> bool
Check if the slot matches the expected generation.
Auto Trait Implementations§
impl !Freeze for VarSlotMeta
impl RefUnwindSafe for VarSlotMeta
impl Send for VarSlotMeta
impl Sync for VarSlotMeta
impl Unpin for VarSlotMeta
impl UnwindSafe for VarSlotMeta
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