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 {
156 pub unsafe fn into_box(self, len: usize) -> Box<[MaybeUninit<T>], A> { in into_box() argument
165 let slice = slice::from_raw_parts_mut(me.ptr() as *mut MaybeUninit<T>, len); in into_box()
173 if mem::size_of::<T>() == 0 || capacity == 0 { in allocate_in()
178 let layout = match Layout::array::<T>(capacity) { in allocate_in()
217 pub unsafe fn from_raw_parts_in(ptr: *mut T, capacity: usize, alloc: A) -> Self { in from_raw_parts_in() argument
225 pub fn ptr(&self) -> *mut T { in ptr() argument
234 if mem::size_of::<T>() == 0 { usize::MAX } else { self.cap } in capacity()
243 if mem::size_of::<T>() == 0 || self.cap == 0 { in current_memory()
249 let layout = Layout::array::<T>(self.cap).unwrap_unchecked(); in current_memory()
282 fn do_reserve_and_handle<T, A: Allocator>( in reserve() argument
283 slf: &mut RawVec<T, A>, in reserve() argument
365 impl<T, A: Allocator> RawVec<T, A> {
391 if mem::size_of::<T>() == 0 { in grow_amortized()
405 let new_layout = Layout::array::<T>(cap); in grow_amortized()
417 if mem::size_of::<T>() == 0 { in grow_exact()
424 let new_layout = Layout::array::<T>(cap); in grow_exact()
441 let new_layout = Layout::array::<T>(cap).unwrap_unchecked(); in shrink()
483 unsafe impl<#[may_dangle] T, A: Allocator> Drop for RawVec<T, A> {