Lines Matching refs:T
54 pub(crate) struct RawVec<T, A: Allocator = Global> {
55 ptr: Unique<T>,
60 impl<T> RawVec<T, Global> {
107 impl<T, A: Allocator> RawVec<T, A> {
113 pub(crate) const MIN_NON_ZERO_CAP: usize = if mem::size_of::<T>() == 1 {
115 } else if mem::size_of::<T>() <= 1024 {
163 pub unsafe fn into_box(self, len: usize) -> Box<[MaybeUninit<T>], A> { in into_box() argument
172 let slice = slice::from_raw_parts_mut(me.ptr() as *mut MaybeUninit<T>, len); in into_box()
180 if mem::size_of::<T>() == 0 || capacity == 0 { in allocate_in()
185 let layout = match Layout::array::<T>(capacity) { in allocate_in()
215 if mem::size_of::<T>() == 0 || capacity == 0 { in try_allocate_in()
219 let layout = Layout::array::<T>(capacity).map_err(|_| CapacityOverflow)?; in try_allocate_in()
248 pub unsafe fn from_raw_parts_in(ptr: *mut T, capacity: usize, alloc: A) -> Self { in from_raw_parts_in() argument
256 pub fn ptr(&self) -> *mut T { in ptr() argument
265 if mem::size_of::<T>() == 0 { usize::MAX } else { self.cap } in capacity()
274 if mem::size_of::<T>() == 0 || self.cap == 0 { in current_memory()
280 let layout = Layout::array::<T>(self.cap).unwrap_unchecked(); in current_memory()
313 fn do_reserve_and_handle<T, A: Allocator>( in reserve() argument
314 slf: &mut RawVec<T, A>, in reserve() argument
396 impl<T, A: Allocator> RawVec<T, A> {
422 if mem::size_of::<T>() == 0 { in grow_amortized()
436 let new_layout = Layout::array::<T>(cap); in grow_amortized()
448 if mem::size_of::<T>() == 0 { in grow_exact()
455 let new_layout = Layout::array::<T>(cap); in grow_exact()
472 let new_layout = Layout::array::<T>(cap).unwrap_unchecked(); in shrink()
514 unsafe impl<#[may_dangle] T, A: Allocator> Drop for RawVec<T, A> {