pub struct RustyAlloc;Expand description
The global allocator handle (zero-sized).
It holds no state: every RustyAlloc is the same allocator, so copying
one, or making another, gives a handle that frees what any other
allocated.
Trait Implementations§
Source§impl Allocator for RustyAlloc
impl Allocator for RustyAlloc
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§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 moreSource§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 moreSource§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
Source§impl Clone for RustyAlloc
impl Clone for RustyAlloc
impl Copy for RustyAlloc
Source§impl Debug for RustyAlloc
impl Debug for RustyAlloc
Source§impl Default for RustyAlloc
impl Default for RustyAlloc
Source§impl GlobalAlloc for RustyAlloc
impl GlobalAlloc for RustyAlloc
Source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given
layout. Read moreAuto Trait Implementations§
impl Forget for RustyAlloc
impl Freeze for RustyAlloc
impl Move for RustyAlloc
impl RefUnwindSafe for RustyAlloc
impl Send for RustyAlloc
impl Sync for RustyAlloc
impl Unpin for RustyAlloc
impl UnsafeUnpin for RustyAlloc
impl UnwindSafe for RustyAlloc
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