Lines Matching refs:alloc

5 use core::alloc::LayoutError;
14 use crate::alloc::handle_alloc_error;
15 use crate::alloc::{Allocator, Global, Layout};
57 alloc: A, field
123 pub const fn new_in(alloc: A) -> Self { in new_in()
125 Self { ptr: Unique::dangling(), cap: 0, alloc } in new_in()
132 pub fn with_capacity_in(capacity: usize, alloc: A) -> Self { in with_capacity_in()
133 Self::allocate_in(capacity, AllocInit::Uninitialized, alloc) in with_capacity_in()
140 pub fn with_capacity_zeroed_in(capacity: usize, alloc: A) -> Self { in with_capacity_zeroed_in()
141 Self::allocate_in(capacity, AllocInit::Zeroed, alloc) in with_capacity_zeroed_in()
166 Box::from_raw_in(slice, ptr::read(&me.alloc)) in into_box()
171 fn allocate_in(capacity: usize, init: AllocInit, alloc: A) -> Self { in allocate_in()
174 Self::new_in(alloc) in allocate_in()
187 AllocInit::Uninitialized => alloc.allocate(layout), in allocate_in()
188 AllocInit::Zeroed => alloc.allocate_zeroed(layout), in allocate_in()
201 alloc, in allocate_in()
217 pub unsafe fn from_raw_parts_in(ptr: *mut T, capacity: usize, alloc: A) -> Self { in from_raw_parts_in()
218 Self { ptr: unsafe { Unique::new_unchecked(ptr) }, cap: capacity, alloc } in from_raw_parts_in()
239 &self.alloc in allocator()
408 let ptr = finish_grow(new_layout, self.current_memory(), &mut self.alloc)?; in grow_amortized()
427 let ptr = finish_grow(new_layout, self.current_memory(), &mut self.alloc)?; in grow_exact()
442 self.alloc in shrink()
459 alloc: &mut A, in finish_grow()
474 alloc.grow(ptr, old_layout, new_layout) in finish_grow()
477 alloc.allocate(new_layout) in finish_grow()
487 unsafe { self.alloc.deallocate(ptr, layout) } in drop()