Lines Matching defs:RawVec

8288 // … to call `RawVec::with_capacity_zeroed` for creating `Vec<*mut T>`,
8320 // `RawVec::grow_amortized`.
14464 /// free its memory, but it *won't* try to drop its contents. It is up to the user of `RawVec`
14465 /// to handle the actual things *stored* inside of a `RawVec`.
14471 pub struct RawVec<T, A: Allocator = Global> {
14477 impl<T> RawVec<T, Global> {
14481 /// If you change `RawVec<T>::new` or dependencies, please take care to not introduce anything
14485 /// Creates the biggest possible `RawVec` (on the system heap)
14487 /// `RawVec` with capacity `0`. If `T` is zero-sized, then it makes a
14488 /// `RawVec` with capacity `usize::MAX`. Useful for implementing
14494 /// Creates a `RawVec` (on the system heap) with exactly the
14496 /// equivalent to calling `RawVec::new` when `capacity` is `0` or `T` is
14498 /// *not* get a `RawVec` with the requested capacity.
14518 /// Reconstitutes a `RawVec` from a pointer and capacity.
14525 /// If the `ptr` and `capacity` come from a `RawVec`, then this is guaranteed.
14532 impl<T, A: Allocator> RawVec<T, A> {
14547 /// the returned `RawVec`.
14555 /// allocator for the returned `RawVec`.
14562 /// of allocator for the returned `RawVec`.
14568 /// Converts a `Box<[T]>` into a `RawVec<T>`.
14572 RawVec::from_raw_parts_in(slice.as_mut_ptr(), slice.len(), alloc)
14633 /// Reconstitutes a `RawVec` from a pointer, capacity, and allocator.
14641 /// If the `ptr` and `capacity` come from a `RawVec` created via `alloc`, then this is
14664 /// Returns a shared reference to the allocator backing this `RawVec`.
14710 /// # use alloc::raw_vec::RawVec;
14712 /// buf: RawVec<T>,
14730 /// # let mut vector = MyVec { buf: RawVec::new(), len: 0 };
14742 slf: &mut RawVec<T, A>,
14808 impl<T, A: Allocator> RawVec<T, A> {
14838 // 0, getting to here necessarily means the `RawVec` is overfull.
14864 // 0, getting to here necessarily means the `RawVec` is overfull.
14895 // This function is outside `RawVec` to minimize compile times. See the comment
14896 // above `RawVec::grow_amortized` for details. (The `A` parameter isn't
14908 // Check for the error here to minimize the size of `RawVec::grow_*`.
14927 unsafe impl<#[may_dangle] T, A: Allocator> Drop for RawVec<T, A> {
14928 /// Frees the memory owned by the `RawVec` *without* trying to drop its contents.
40378 use crate::raw_vec::RawVec;
40448 buf: RawVec<T>,
40494 // RawVec handles deallocation
40837 VecDeque { tail: 0, head: 0, buf: RawVec::with_capacity(cap) }
43228 let buf = RawVec::from_raw_parts(other_buf, capacity);
45848 use crate::raw_vec::RawVec;
45950 self.buf = unsafe { NonNull::new_unchecked(RawVec::NEW.ptr()) };
46095 // RawVec handles deallocation
46096 let _ = RawVec::from_raw_parts_in(self.0.buf.as_ptr(), self.0.cap, alloc);
46223 use crate::raw_vec::RawVec;
46245 return Vec { buf: RawVec::with_capacity_zeroed_in(n, alloc), len: n };
46260 return Vec { buf: RawVec::with_capacity_zeroed_in(n, alloc), len: n };
46275 return Vec { buf: RawVec::with_capacity_zeroed_in(n, alloc), len: n };
46880 use crate::raw_vec::RawVec;
47183 buf: RawVec<T, A>,
47206 Vec { buf: RawVec::NEW, len: 0 }
47340 Vec { buf: RawVec::new_in(alloc), len: 0 }
47388 Vec { buf: RawVec::with_capacity_in(capacity, alloc), len: 0 }
47464 unsafe { Vec { buf: RawVec::from_raw_parts_in(ptr, capacity, alloc), len: length } }
47715 // they are equal, so we can avoid the panic case in `RawVec::shrink_to_fit`
49477 // RawVec handles deallocation
50325 use crate::raw_vec::RawVec;
50722 unsafe { RawVec::with_capacity(len).into_box(len) }
50745 unsafe { RawVec::with_capacity_zeroed(len).into_box(len) }
50775 unsafe { RawVec::with_capacity_in(len, alloc).into_box(len) }
50801 unsafe { RawVec::with_capacity_zeroed_in(len, alloc).into_box(len) }
51404 let buf = RawVec::with_capacity(len);
51874 // allocators and `RawVec` is a little tricky because the `RawVec`
51879 // Instead, this just checks that the `RawVec` methods do at
51908 let mut v: RawVec<u8, _> = RawVec::with_capacity_in(50, a);
51917 let mut v: RawVec<u32> = RawVec::new();
51924 let mut v: RawVec<u32> = RawVec::new();
51934 let mut v: RawVec<u32> = RawVec::new();