//! # Memory Layout Orchestrator
//!
//! This module ensures that all slab allocations follow the strict "Size == Alignment"
//! invariant required for our high-speed deallocation math.
//!
//! ## The Masking Trick
//!
//! In our system, if a Slab has a size of 4096 bytes (a power of two), it is also
//! **aligned** to a 4096-byte boundary. This allows us to perform a "constant-time
//! home lookup":
//!
//! For any pointer `P` belonging to a slab, the header is located at:
//! `header_address = P & !(SLAB_SIZE - 1)`
//!
//! `get_layout` enforces this alignment at the moment of allocation.
use Layout;
/// Generates a [`Layout`] where the alignment is strictly equal to the size.
///
/// This function is intended for use in `SlabCache` to define the raw memory
/// properties of a new Master or Slave segment.
///
/// # Panics
/// Panics if `slab_size` is not a power of two, as `Layout` construction
/// will fail. In practice, this is caught at compile-time by `SlabCache` assertions.
pub const