pub struct Scoped;
Expand description
Scoped allocator
Trait Implementations§
source§impl Allocator for Scoped
impl Allocator for Scoped
source§fn allocate(&self, _layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, _layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Attempts to allocate a block of memory. Read more
source§unsafe fn deallocate(&self, _ptr: NonNull<u8>, _layout: Layout)
unsafe fn deallocate(&self, _ptr: NonNull<u8>, _layout: Layout)
Deallocates the memory referenced by
ptr
. Read more§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Behaves like
allocate
, but also ensures that the returned memory is zero-initialized. Read more§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Attempts to extend the memory block. Read more
§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Behaves like
grow
, but also ensures that the new contents are set to zero before being
returned. Read moreAuto Trait Implementations§
impl Freeze for Scoped
impl RefUnwindSafe for Scoped
impl Send for Scoped
impl Sync for Scoped
impl Unpin for Scoped
impl UnwindSafe for Scoped
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more