Expand description
Utility helpers for alignment, page size, and safe range calculations.
Functionsยง
- align_
up - Align a value up to the nearest multiple of
alignment. - ensure_
in_ bounds - Ensure the requested [offset, offset+len) range is within [0, total).
Returns
Ok(())if valid; otherwise anOutOfBoundserror. - page_
size - Get the system page size in bytes.
- slice_
range - Compute a safe byte slice range for a given total length, returning start..end as usize tuple.