Home
last modified time | relevance | path

Searched refs:size_of (Results 1 – 25 of 28) sorted by relevance

12

/linux/rust/kernel/sync/
H A Dlocked_by.rs7 use core::{cell::UnsafeCell, mem::size_of, ptr};
104 size_of::<Lock<U, B>>() > 0, in new()
130 size_of::<U>() > 0, in access()
159 size_of::<U>() > 0, in access_mut()
/linux/rust/kernel/sync/atomic/
H A Dpredefine.rs8 static_assert!(size_of::<bool>() == size_of::<i8>());
98 static_assert!(size_of::<isize>() == size_of::<isize_atomic_repr>());
100 static_assert!(size_of::<usize>() == size_of::<isize_atomic_repr>());
/linux/rust/zerocopy/src/util/
H A Dmacro_util.rs308 pub const fn size_of<T: Sized + ?core::marker::Sized>() -> usize { in size_of() function
309 core::mem::size_of::<T>() in size_of()
314 pub use core::mem::size_of;
317 pub use __size_of::size_of;
338 … $crate::util::macro_util::size_of::<$t>() - (0 $(+ $crate::util::macro_util::size_of::<$ts>())*)
393 …let padding = $crate::util::macro_util::size_of::<$t>() - $crate::util::macro_util::size_of::<$ts>…
431 let padding = $crate::util::macro_util::size_of::<$t>()
433 $crate::util::macro_util::size_of::<$disc>()
434 $(+ $crate::util::macro_util::size_of::<$ts>())*
486 if name.len() <= size_of::<u128>() { in hash_name()
[all …]
H A Dmod.rs306 static_assert!(Src, Dst => core::mem::size_of::<Src>() == core::mem::size_of::<Dst>()); in transmute_unchecked()
/linux/rust/kernel/
H A Dptr.rs10 size_of, //
236 /// This is a generalization of [`size_of`] that works for dynamically sized types.
249 const MIN_SIZE: usize = size_of::<T>();
254 size_of::<T>()
264 p.len() * size_of::<T>()
H A Dbug.rs43 size = const ::core::mem::size_of::<$crate::bindings::bug_entry>(),
74 size = const ::core::mem::size_of::<$crate::bindings::bug_entry>(),
H A Duaccess.rs18 use core::mem::{size_of, MaybeUninit};
340 let len = size_of::<T>(); in read()
603 let len = size_of::<T>(); in write()
H A Ddma.rs675 core::mem::size_of::<T>() > 0, in field_read()
685 core::mem::size_of::<T>(),
786 core::mem::size_of::<T>() > 0, in init_with_attrs()
796 let size = core::mem::size_of::<T>().checked_mul(len).ok_or(ENOMEM)?; in init_with_attrs()
H A Dprelude.rs19 size_of,
H A Ddevice_id.rs
H A Dio.rs182 if let Some(end) = offset.checked_add(size_of::<U>()) { in offset_valid()
307 core::ptr::slice_from_raw_parts_mut::<u8>(ptr.cast(), size_of::<T>()), in copy_read()
331 core::ptr::slice_from_raw_parts_mut::<u8>(ptr.cast(), size_of::<T>()), in copy_write()
473 if size_of::<U>() > KnownSize::size(ptr) { in try_cast()
H A Ddevres.rs228 core::mem::size_of::<Revocable<T>>(), in new()
/linux/rust/
H A Dffi.rs20 ::core::mem::size_of::<$name>() == ::core::mem::size_of::<::core::ffi::$name>()
/linux/rust/zerocopy/src/pointer/
H A Dmod.rs131 static_assert!(Src, Dst => mem::size_of::<Src>() >= mem::size_of::<Dst>()); in project()
158 static_assert!(Src, Dst => mem::size_of::<Src>() == mem::size_of::<Dst>()); in project()
/linux/rust/zerocopy/src/
H A Dref.rs211 if bytes.len() != mem::size_of::<T>() { in sized_from()
229 if bytes.len() < mem::size_of::<T>() { in sized_from_prefix()
235 let (bytes, suffix) = bytes.split_at(mem::size_of::<T>()).map_err( in sized_from_prefix()
251 let split_at = if let Some(split_at) = bytes_len.checked_sub(mem::size_of::<T>()) { in sized_from_suffix()
1200 let n = (usize::MAX / mem::size_of::<AU64>()) + 1; in test_new_error()
1228 let unreasonable_len = usize::MAX / mem::size_of::<AU64>() + 1; in test_new_error()
H A Dbyteorder.rs808 mem::size_of::<usize>() * 8,
809 mem::size_of::<usize>(),
893 mem::size_of::<isize>() * 8,
894 mem::size_of::<isize>(),
1180 type ByteArray = [u8; mem::size_of::<$native>()];
1196 fn from_bytes(bytes: [u8; mem::size_of::<$native>()]) -> $name<O> {
1200 fn into_bytes(self) -> [u8; mem::size_of::<$native>()] {
1201 <[u8; mem::size_of::<$native>()]>::from(self)
H A Dimpls.rs1414 unsafe { ptr::write_bytes(ptr.cast::<u8>(), 0xFF, mem::size_of::<T>()) }; in test_impls()
1435 for pos in 0..mem::size_of::<Self>() { in test_impls()
1436 let mut bytes = [0u8; mem::size_of::<Self>()]; in test_impls()
1556 @failure [0x01; mem::size_of::<*const NotZerocopy>()]; in test_impls()
1559 @failure [0x01; mem::size_of::<*mut NotZerocopy>()]; in test_impls()
H A Dlayout.rs17 const POINTER_WIDTH_BITS: usize = mem::size_of::<usize>() * 8;
219 size_info: SizeInfo::Sized { size: mem::size_of::<T>() }, in for_type()
258 elem_size: mem::size_of::<T>(), in for_slice()
/linux/rust/kernel/block/mq/
H A Dtag_set.rs42 let tag_set: Result<_> = core::mem::size_of::<RequestDataWrapper>() in new()
/linux/rust/kernel/debugfs/
H A Dcallback_adapters.rs124 const { assert!(core::mem::size_of::<F>() == 0) };
/linux/rust/kernel/drm/
H A Dioctl.rs125 ::core::assert!(core::mem::size_of::<$crate::uapi::$struct>() ==
/linux/rust/kernel/alloc/
H A Dkvec.rs135 /// Represents the actual buffer size as `cap` times `size_of::<T>` bytes.
205 core::mem::size_of::<T>() == 0 in inc_len()
596 /// - `ptr` must point to memory with a size of at least `size_of::<T>() * capacity` bytes.
607 // SAFETY: By the safety requirements of this function, `capacity * size_of::<T>()` is
808 /// let elements_per_page = kernel::page::PAGE_SIZE / core::mem::size_of::<u32>(); in shrink_to()
853 let current_size = self.capacity() * core::mem::size_of::<T>(); in extend_with()
854 let target_size = target_cap * core::mem::size_of::<T>(); in extend_with()
1042 // - `ptr` points to memory with at least a size of `size_of::<T>() * len`, in borrow()
1333 // - `ptr` is valid for reads of `len * size_of::<T>()` bytes, in next()
1334 // - `buf.as_ptr()` is valid for writes of `len * size_of in next()
[all...]
H A Dkbox.rs750 let size = core::mem::size_of::<T>();
/linux/drivers/net/ethernet/intel/i40e/
H A Di40e_lan_hmc.c663 u16 size_of; member
943 switch (ce_info[f].size_of) { in i40e_set_hmc_context()
/linux/rust/zerocopy-derive/derive/
H A Dtry_from_bytes.rs384 { #core::mem::size_of::<___ZerocopyTag>() }, in derive_is_bit_valid()

12