Lines Matching refs:align
48 // INVARIANT: `align` is a power of two.
49 // SAFETY: `align` is a power of two, and thus non-zero.
53 /// Validates that `align` is a power of two at runtime, and returns an
56 /// Returns [`None`] if `align` is not a power of two.
69 pub const fn new_checked(align: usize) -> Option<Self> {
70 if align.is_power_of_two() {
71 // INVARIANT: `align` is a power of two.
72 // SAFETY: `align` is a power of two, and thus non-zero.
73 Some(Self(unsafe { NonZero::new_unchecked(align) }))
206 .map(|align| self & !(align.get() - 1))
219 .and_then(|align| aligned_down.checked_add(align))