Skip to main content

align_size

Function align_size 

Source
pub const fn align_size(size: usize, up: bool) -> usize
Expand description

Align a size to the minimum alignment.

Matches IResizableBuffer::AlignSize(size, up):

if (up) size += s_MinAlignment - 1;
return size & ~static_cast<size_t>((1 << s_MinAlignment) - 1);

With s_MinAlignment = 4, (1 << 4) - 1 = 15, so this rounds to a multiple of 16.