pub struct LockedHeapWithRescue<const ORDER: usize> { /* private fields */ }Expand description
A locked version of Heap with rescue before oom
§Usage
Create a locked heap:
use buddy_system_allocator::*;
let heap = LockedHeapWithRescue::new(|heap: &mut Heap<33>, layout: &core::alloc::Layout| {});Before oom, the allocator will try to call rescue function and try for one more time.
Implementations§
Trait Implementations§
Source§impl<const ORDER: usize> Deref for LockedHeapWithRescue<ORDER>
Available on crate feature use_spin only.
impl<const ORDER: usize> Deref for LockedHeapWithRescue<ORDER>
Available on crate feature
use_spin only.Source§impl<const ORDER: usize> GlobalAlloc for LockedHeapWithRescue<ORDER>
Available on crate feature use_spin only.
impl<const ORDER: usize> GlobalAlloc for LockedHeapWithRescue<ORDER>
Available on crate feature
use_spin only.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 moreAuto Trait Implementations§
impl<const ORDER: usize> !Freeze for LockedHeapWithRescue<ORDER>
impl<const ORDER: usize> !RefUnwindSafe for LockedHeapWithRescue<ORDER>
impl<const ORDER: usize> Send for LockedHeapWithRescue<ORDER>
impl<const ORDER: usize> Sync for LockedHeapWithRescue<ORDER>
impl<const ORDER: usize> Unpin for LockedHeapWithRescue<ORDER>
impl<const ORDER: usize> UnwindSafe for LockedHeapWithRescue<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