Skip to main content

try_reserve_aligned

Function try_reserve_aligned 

Source
pub fn try_reserve_aligned(
    size: usize,
    align: usize,
) -> Result<Reservation, VmemError>
Expand description

Fallible reserve_aligned: returns a VmemError carrying the OS cause (errno / GetLastError) on failure instead of a bare None.

A contract violation (bad size/align) returns VmemError::invalid_argument without touching the OS.