Function zerocopy::util::round_down_to_next_multiple_of_alignment
source · pub(crate) const fn round_down_to_next_multiple_of_alignment(
n: usize,
align: NonZeroUsize,
) -> usize
Expand description
Round n
down to the largest value m
such that m <= n
and m % align == 0
.
§Panics
May panic if align
is not a power of two. Even if it doesn’t panic in this
case, it will produce nonsense results.