pub unsafe trait Fallbackable: Allocator {
    // Required methods
    unsafe fn has_allocated(&self, ptr: NonNull<u8>, layout: Layout) -> bool;
    fn allows_fallback(&self, layout: Layout) -> bool;
}
Expand description

Safety

The allows_fallback function should be pure, i.e. always return same value for same layout.

An implementer of this trait should return true from has_allocated if and only if at least one of the following conditions is satisfied:

Required Methods§

source

unsafe fn has_allocated(&self, ptr: NonNull<u8>, layout: Layout) -> bool

Safety

The ptr parameter should denote a memory block, currently allocated by this or any other Allocator.

The layout parameter should fit the memory block denoting by ptr.

source

fn allows_fallback(&self, layout: Layout) -> bool

Implementations on Foreign Types§

source§

impl<'a, T: Fallbackable + ?Sized> Fallbackable for &'a T

source§

unsafe fn has_allocated(&self, ptr: NonNull<u8>, layout: Layout) -> bool

source§

fn allows_fallback(&self, layout: Layout) -> bool

Implementors§