struct Allocator {
inner: Option<LockedHeap>,
allocated_count: AtomicUsize,
allocated_bytes: AtomicUsize,
}
Fields§
§inner: Option<LockedHeap>
§allocated_count: AtomicUsize
§allocated_bytes: AtomicUsize
Implementations§
Trait Implementations§
Source§impl GlobalAlloc for Allocator
impl GlobalAlloc for Allocator
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 more1.28.0§unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
Behaves like
alloc
, but also ensures that the contents
are set to zero before being returned. Read more