Struct buddy_system_allocator::FrameAllocator
source · [−]pub struct FrameAllocator { /* private fields */ }
Expand description
A frame allocator that uses buddy system, requiring a global allocator
Usage
Create a frame allocator and add some frames to it:
use buddy_system_allocator::*;
let mut frame = FrameAllocator::new();
assert!(frame.alloc(1).is_none());
frame.add_frame(0, 3);
let num = frame.alloc(1);
assert_eq!(num, Some(2));
let num = frame.alloc(2);
assert_eq!(num, Some(0));
Implementations
sourceimpl FrameAllocator
impl FrameAllocator
Auto Trait Implementations
impl RefUnwindSafe for FrameAllocator
impl Send for FrameAllocator
impl Sync for FrameAllocator
impl Unpin for FrameAllocator
impl UnwindSafe for FrameAllocator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more