Skip to main content

align_down

Function align_down 

Source
pub const fn align_down(val: usize, alignment: usize) -> usize
Expand description

Returns the largest value smaller than or equal to val that is a multiple of alignment.

You can use this together with page_size to align your regions for committing/decommitting.

alignment must be a power of two (which implies that it must be nonzero).