Lines Matching refs:alloc
158 use crate::alloc::{handle_alloc_error, WriteCloneIntoRaw};
159 use crate::alloc::{AllocError, Allocator, Global, Layout};
361 pub const fn new_in(x: T, alloc: A) -> Self in new_in()
365 let mut boxed = Self::new_uninit_in(alloc); in new_in()
390 pub const fn try_new_in(x: T, alloc: A) -> Result<Self, AllocError> in try_new_in()
395 let mut boxed = Self::try_new_uninit_in(alloc)?; in try_new_in()
427 pub const fn new_uninit_in(alloc: A) -> Box<mem::MaybeUninit<T>, A> in new_uninit_in()
434 match Box::try_new_uninit_in(alloc) { in new_uninit_in()
465 pub const fn try_new_uninit_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocError> in try_new_uninit_in()
470 let ptr = alloc.allocate(layout)?.cast(); in try_new_uninit_in()
471 unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } in try_new_uninit_in()
499 pub const fn new_zeroed_in(alloc: A) -> Box<mem::MaybeUninit<T>, A> in new_zeroed_in()
506 match Box::try_new_zeroed_in(alloc) { in new_zeroed_in()
537 pub const fn try_new_zeroed_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocError> in try_new_zeroed_in()
542 let ptr = alloc.allocate_zeroed(layout)?.cast(); in try_new_zeroed_in()
543 unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } in try_new_zeroed_in()
553 pub const fn pin_in(x: T, alloc: A) -> Pin<Self> in pin_in()
557 Self::into_pin(Self::new_in(x, alloc)) in pin_in()
566 let (raw, alloc) = Box::into_raw_with_allocator(boxed); in into_boxed_slice()
567 unsafe { Box::from_raw_in(raw as *mut [T; 1], alloc) } in into_boxed_slice()
738 pub fn new_uninit_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A> { in new_uninit_slice_in()
739 unsafe { RawVec::with_capacity_in(len, alloc).into_box(len) } in new_uninit_slice_in()
766 pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A> { in new_zeroed_slice_in()
767 unsafe { RawVec::with_capacity_zeroed_in(len, alloc).into_box(len) } in new_zeroed_slice_in()
804 let (raw, alloc) = Box::into_raw_with_allocator(self); in assume_init()
805 unsafe { Box::from_raw_in(raw as *mut T, alloc) } in assume_init()
880 let (raw, alloc) = Box::into_raw_with_allocator(self); in assume_init()
881 unsafe { Box::from_raw_in(raw as *mut [T], alloc) } in assume_init()
985 pub const unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { in from_raw_in()
986 Box(unsafe { Unique::new_unchecked(raw) }, alloc) in from_raw_in()
1084 let (leaked, alloc) = Box::into_unique(b); in into_raw_with_allocator()
1085 (leaked.as_ptr(), alloc) in into_raw_with_allocator()
1102 let alloc = unsafe { ptr::read(&b.1) }; in into_unique() localVariable
1103 (Unique::from(Box::leak(b)), alloc) in into_unique()
1538 let (raw, alloc) = Box::into_raw_with_allocator(s); in from()
1539 unsafe { Box::from_raw_in(raw as *mut [u8], alloc) } in from()
1636 let (raw, alloc): (*mut dyn Any, _) = Box::into_raw_with_allocator(self); in downcast_unchecked()
1637 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
1695 let (raw, alloc): (*mut (dyn Any + Send), _) = Box::into_raw_with_allocator(self); in downcast_unchecked()
1696 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
1754 let (raw, alloc): (*mut (dyn Any + Send + Sync), _) = in downcast_unchecked()
1756 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
1912 let alloc = Box::allocator(self).clone(); in clone() localVariable
1913 self.to_vec_in(alloc).into_boxed_slice() in clone()