Struct buddy_system_allocator::LockedHeap
source · pub struct LockedHeap<const ORDER: usize>(/* private fields */);
Expand description
A locked version of Heap
§Usage
Create a locked heap and add a memory region to it:
use buddy_system_allocator::*;
let mut heap = LockedHeap::<32>::new();
unsafe {
heap.lock().init(begin, size);
// or
heap.lock().add_to_heap(begin, end);
}
Implementations§
Trait Implementations§
source§impl<const ORDER: usize> Deref for LockedHeap<ORDER>
impl<const ORDER: usize> Deref for LockedHeap<ORDER>
source§impl<const ORDER: usize> GlobalAlloc for LockedHeap<ORDER>
impl<const ORDER: usize> GlobalAlloc for LockedHeap<ORDER>
source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocate memory as described by the given
layout
. Read moreAuto Trait Implementations§
impl<const ORDER: usize> !RefUnwindSafe for LockedHeap<ORDER>
impl<const ORDER: usize> Send for LockedHeap<ORDER>
impl<const ORDER: usize> Sync for LockedHeap<ORDER>
impl<const ORDER: usize> Unpin for LockedHeap<ORDER>
impl<const ORDER: usize> UnwindSafe for LockedHeap<ORDER>
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