Struct multiple_heaps::MultipleHeaps
source · pub struct MultipleHeaps { /* private fields */ }
Expand description
An allocator that contains multiple heaps. The heap that is used on each allocation is determined by a key. Currently the apic id is used as the key.
Implementations§
source§impl MultipleHeaps
impl MultipleHeaps
pub fn empty() -> MultipleHeaps
Trait Implementations§
source§impl GlobalAlloc for MultipleHeaps
impl GlobalAlloc for MultipleHeaps
source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates the given layout
from the heap of the core the task is currently running on.
If the per-core heap is not initialized, then an error is returned.
source§unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
Deallocates the memory at the address given by ptr
.
Memory is returned to the per-core heap it was allocated from.