#[repr(C)]pub struct LlmpPage {
pub magic: u64,
pub sender_id: ClientId,
pub receivers_joined_count: AtomicU16,
pub receivers_left_count: AtomicU16,
pub current_msg_id: AtomicU64,
pub size_total: usize,
pub size_used: usize,
pub max_alloc_size: usize,
pub messages: [LlmpMsg; 0],
}Expand description
Contents of the share mem pages, used by llmp internally
Fields§
§magic: u64to check if this page got initialized properly
sender_id: ClientIdThe id of the sender
receivers_joined_count: AtomicU16Set to != 1 by the receiver, once it got mapped. It’s not safe for the sender to unmap this page before (The os may have tidied up the memory when the receiver starts to map)
receivers_left_count: AtomicU16Set to != 1 by the receiver, once it left again after joining.
It’s not safe for the sender to re-map this page before this is equal to receivers_joined_count
current_msg_id: AtomicU64The current message ID It also servers to know whether the next message can be read or not.
size_total: usizeHow much space is available on this page in bytes
size_used: usizeHow much space is used on this page in bytes
max_alloc_size: usizeThe maximum amount of bytes that ever got allocated on this page in one go. An inidactor of what to use as size for future pages
messages: [LlmpMsg; 0]Pointer to the messages, from here on.