Skip to main content

release

Function release 

Source
pub unsafe fn release(
    reservation: *mut u8,
    reservation_len: usize,
    align: usize,
)
Expand description

Release a whole OS reservation obtained from Reservation::into_parts.

§Safety

reservation, reservation_len and align must be the three values returned by Reservation::into_parts (or, for a self-hosting caller that always uses one alignment, that same alignment constant), and the reservation must be released exactly once. A double release is a contract violation. The native (munmap / VirtualFree) paths ignore align; it is consulted only by the miri fallback to reconstruct the exact Layout.