pub struct Allocator { /* private fields */ }
Expand description
The actual Allocator Struct, which can be used for allocating and freeing memory
Implementations
sourceimpl Allocator
impl Allocator
sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new Instance of the Allocator
Note
All Instances of the Allocator share some amount of Data, so they are currently not independant of each other. You should only create a single Instance for use as the Global-Allocator of your program
Trait Implementations
sourceimpl GlobalAlloc for Allocator
impl GlobalAlloc for Allocator
sourceunsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocate memory as described by the given layout
. Read more
sourceunsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
Deallocate the block of memory at the given ptr
pointer with the given layout
. Read more
Auto Trait Implementations
impl RefUnwindSafe for Allocator
impl Send for Allocator
impl Sync for Allocator
impl Unpin for Allocator
impl UnwindSafe for Allocator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more