pub struct Allocator<A> { /* private fields */ }
Expand description
Tracking allocator implementation.
This allocator must be installed via #[global_allocator]
in order to take effect. More
information on using this allocator can be found in the examples, or directly in the standard
library docs for GlobalAlloc
.
Implementations§
Source§impl<A> Allocator<A>
impl<A> Allocator<A>
Sourcepub const fn from_allocator(allocator: A) -> Self
pub const fn from_allocator(allocator: A) -> Self
Creates a new Allocator
that wraps another allocator.
Trait Implementations§
Source§impl<A: GlobalAlloc> GlobalAlloc for Allocator<A>
impl<A: GlobalAlloc> GlobalAlloc for Allocator<A>
Source§unsafe fn alloc(&self, object_layout: Layout) -> *mut u8
unsafe fn alloc(&self, object_layout: Layout) -> *mut u8
Allocates memory as described by the given
layout
. Read moreAuto Trait Implementations§
impl<A> Freeze for Allocator<A>where
A: Freeze,
impl<A> RefUnwindSafe for Allocator<A>where
A: RefUnwindSafe,
impl<A> Send for Allocator<A>where
A: Send,
impl<A> Sync for Allocator<A>where
A: Sync,
impl<A> Unpin for Allocator<A>where
A: Unpin,
impl<A> UnwindSafe for Allocator<A>where
A: UnwindSafe,
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