Skip to main content

align_index

Function align_index 

Source
pub const fn align_index(align: usize, index: usize) -> usize
Expand description

Returns the least aligned index not smaller than index.

  • Precondition: align is a power of two and index + align - 1 is representable.

ยงExamples

assert_eq!(cel_runtime::memory::align_index(8, 9), 16);