Home
last modified time | relevance | path

Searched refs:align_of (Results 1 – 13 of 13) sorted by relevance

/linux/rust/zerocopy/src/util/
H A Dmacro_util.rs234 macro_rules! align_of { macro
729 static_assert!(Src, Dst => mem::align_of::<Dst>() <= mem::align_of::<Src>()); in transmute_ref()
759 static_assert!(Src => mem::align_of::<Src>() == mem::align_of::<Wrapping<Src>>()); in try_transmute_ref()
760 static_assert!(Dst => mem::align_of::<Dst>() == mem::align_of::<Wrapping<Dst>>()); in try_transmute_ref()
817 static_assert!(Src, Dst => mem::align_of::<Dst>() <= mem::align_of::<Src>()); in transmute_mut()
839 static_assert!(Src => mem::align_of::<Src>() == mem::align_of::<Wrapping<Src>>()); in try_transmute_mut()
840 static_assert!(Dst => mem::align_of::<Dst>() == mem::align_of::<Wrapping<Dst>>()); in try_transmute_mut()
965 assert_eq!(mem::align_of::<Aligned64kAllocation>(), _64K); in test_trailing_field_offset()
1077 assert_eq!(align_of!([elain::Align<1>]), Some(1)); in test_align_of_dst()
1078 assert_eq!(align_of!([elain::Align<2>]), Some(2)); in test_align_of_dst()
[all …]
H A Dmod.rs131 let remainder = t.addr() % mem::align_of::<U>(); in validate_aligned_to()
H A Dmacros.rs541 static_assertions::const_assert_eq!(core::mem::align_of::<$tys>(), 1);
/linux/rust/kernel/sync/atomic/
H A Dpredefine.rs9 static_assert!(align_of::<bool>() == align_of::<i8>());
99 static_assert!(align_of::<isize>() == align_of::<isize_atomic_repr>());
101 static_assert!(align_of::<usize>() == align_of::<isize_atomic_repr>());
/linux/rust/kernel/
H A Dptr.rs9 align_of,
87 /// This is equivalent to [`align_of`], but with the return value provided as an [`Alignment`].
93 const { Alignment::new_checked(align_of::<T>()).unwrap() } in of()
H A Dprelude.rs17 align_of,
H A Dtypes.rs141 const FOREIGN_ALIGN: usize = core::mem::align_of::<()>();
H A Dio.rs183 end <= size && (base.wrapping_add(offset) % align_of::<U>() == 0) in offset_valid()
477 if ptr.addr() % align_of::<U>() != 0 { in try_cast()
/linux/rust/kernel/alloc/
H A Dkbox.rs511 const FOREIGN_ALIGN: usize = if core::mem::align_of::<T>() < A::MIN_ALIGN {
514 core::mem::align_of::<T>() in borrow_mut()
/linux/rust/zerocopy/src/
H A Dwrappers.rs340 if mem::align_of::<T>() == 1 { in update()
H A Dlayout.rs215 align: match NonZeroUsize::new(mem::align_of::<T>()) { in for_type()
252 align: match NonZeroUsize::new(mem::align_of::<T>()) { in for_slice()
H A Derror.rs376 assert_ne!(core::mem::align_of::<Dst>(), 1); in new_checked()
H A Dlib.rs6526 test!(u64, layout(8, mem::align_of::<u64>(), None, false)); in test_known_layout()