Skip to main content

align_up

Function align_up 

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

Returns the smallest value greater than or equal to val that is a multiple of alignment. Returns zero on overflow.

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).