Lines Matching refs:alloc
171 use crate::alloc::{handle_alloc_error, WriteCloneIntoRaw};
172 use crate::alloc::{AllocError, Allocator, Global, Layout};
382 pub fn new_in(x: T, alloc: A) -> Self in new_in()
386 let mut boxed = Self::new_uninit_in(alloc); in new_in()
410 pub fn try_new_in(x: T, alloc: A) -> Result<Self, AllocError> in try_new_in()
414 let mut boxed = Self::try_new_uninit_in(alloc)?; in try_new_in()
445 pub fn new_uninit_in(alloc: A) -> Box<mem::MaybeUninit<T>, A> in new_uninit_in()
452 match Box::try_new_uninit_in(alloc) { in new_uninit_in()
482 pub fn try_new_uninit_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocError> in try_new_uninit_in()
490 alloc.allocate(layout)?.cast() in try_new_uninit_in()
492 unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } in try_new_uninit_in()
519 pub fn new_zeroed_in(alloc: A) -> Box<mem::MaybeUninit<T>, A> in new_zeroed_in()
526 match Box::try_new_zeroed_in(alloc) { in new_zeroed_in()
556 pub fn try_new_zeroed_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocError> in try_new_zeroed_in()
564 alloc.allocate_zeroed(layout)?.cast() in try_new_zeroed_in()
566 unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } in try_new_zeroed_in()
580 pub fn pin_in(x: T, alloc: A) -> Pin<Self> in pin_in()
584 Self::into_pin(Self::new_in(x, alloc)) in pin_in()
592 let (raw, alloc) = Box::into_raw_with_allocator(boxed); in into_boxed_slice()
593 unsafe { Box::from_raw_in(raw as *mut [T; 1], alloc) } in into_boxed_slice()
764 pub fn new_uninit_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A> { in new_uninit_slice_in()
765 unsafe { RawVec::with_capacity_in(len, alloc).into_box(len) } in new_uninit_slice_in()
792 pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A> { in new_zeroed_slice_in()
793 unsafe { RawVec::with_capacity_zeroed_in(len, alloc).into_box(len) } in new_zeroed_slice_in()
829 let (raw, alloc) = Box::into_raw_with_allocator(self); in assume_init()
830 unsafe { Box::from_raw_in(raw as *mut T, alloc) } in assume_init()
904 let (raw, alloc) = Box::into_raw_with_allocator(self); in assume_init()
905 unsafe { Box::from_raw_in(raw as *mut [T], alloc) } in assume_init()
1010 pub const unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { in from_raw_in()
1011 Box(unsafe { Unique::new_unchecked(raw) }, alloc) in from_raw_in()
1108 let (leaked, alloc) = Box::into_unique(b); in into_raw_with_allocator()
1109 (leaked.as_ptr(), alloc) in into_raw_with_allocator()
1125 let alloc = unsafe { ptr::read(&b.1) }; in into_unique() localVariable
1126 (Unique::from(Box::leak(b)), alloc) in into_unique()
1626 let (raw, alloc) = Box::into_raw_with_allocator(s); in from()
1627 unsafe { Box::from_raw_in(raw as *mut [u8], alloc) } in from()
1659 let (ptr, alloc) = Box::into_raw_with_allocator(boxed_slice);
1662 unsafe { Box::from_raw_in(ptr as *mut [T; N], alloc) }
1773 let (raw, alloc): (*mut dyn Any, _) = Box::into_raw_with_allocator(self); in downcast_unchecked()
1774 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
1832 let (raw, alloc): (*mut (dyn Any + Send), _) = Box::into_raw_with_allocator(self); in downcast_unchecked()
1833 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
1891 let (raw, alloc): (*mut (dyn Any + Send + Sync), _) = in downcast_unchecked()
1893 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
2047 let alloc = Box::allocator(self).clone(); in clone() localVariable
2048 self.to_vec_in(alloc).into_boxed_slice() in clone()