Lines Matching refs:alloc

5 use core::alloc::LayoutError;
13 use crate::alloc::handle_alloc_error;
14 use crate::alloc::{Allocator, Global, Layout};
56 alloc: A, field
122 pub const fn new_in(alloc: A) -> Self { in new_in()
124 Self { ptr: Unique::dangling(), cap: 0, alloc } in new_in()
131 pub fn with_capacity_in(capacity: usize, alloc: A) -> Self { in with_capacity_in()
132 Self::allocate_in(capacity, AllocInit::Uninitialized, alloc) in with_capacity_in()
138 pub fn try_with_capacity_in(capacity: usize, alloc: A) -> Result<Self, TryReserveError> { in try_with_capacity_in()
139 Self::try_allocate_in(capacity, AllocInit::Uninitialized, alloc) in try_with_capacity_in()
146 pub fn with_capacity_zeroed_in(capacity: usize, alloc: A) -> Self { in with_capacity_zeroed_in()
147 Self::allocate_in(capacity, AllocInit::Zeroed, alloc) in with_capacity_zeroed_in()
172 Box::from_raw_in(slice, ptr::read(&me.alloc)) in into_box()
177 fn allocate_in(capacity: usize, init: AllocInit, alloc: A) -> Self { in allocate_in()
180 Self::new_in(alloc) in allocate_in()
193 AllocInit::Uninitialized => alloc.allocate(layout), in allocate_in()
194 AllocInit::Zeroed => alloc.allocate_zeroed(layout), in allocate_in()
207 alloc, in allocate_in()
212 … fn try_allocate_in(capacity: usize, init: AllocInit, alloc: A) -> Result<Self, TryReserveError> { in try_allocate_in()
215 return Ok(Self::new_in(alloc)); in try_allocate_in()
221 AllocInit::Uninitialized => alloc.allocate(layout), in try_allocate_in()
222 AllocInit::Zeroed => alloc.allocate_zeroed(layout), in try_allocate_in()
232 alloc, in try_allocate_in()
247 pub unsafe fn from_raw_parts_in(ptr: *mut T, capacity: usize, alloc: A) -> Self { in from_raw_parts_in()
248 Self { ptr: unsafe { Unique::new_unchecked(ptr) }, cap: capacity, alloc } in from_raw_parts_in()
269 &self.alloc in allocator()
443 let ptr = finish_grow(new_layout, self.current_memory(), &mut self.alloc)?; in grow_amortized()
462 let ptr = finish_grow(new_layout, self.current_memory(), &mut self.alloc)?; in grow_exact()
479 unsafe { self.alloc.deallocate(ptr, layout) }; in shrink()
488 self.alloc in shrink()
506 alloc: &mut A, in finish_grow()
521 alloc.grow(ptr, old_layout, new_layout) in finish_grow()
524 alloc.allocate(new_layout) in finish_grow()
534 unsafe { self.alloc.deallocate(ptr, layout) } in drop()