Trait FrameAllocator
pub unsafe trait FrameAllocator<S>where
S: PageSize,{
// Required method
fn allocate_frame(&mut self) -> Option<PhysFrame<S>>;
}Expand description
A trait for types that can allocate a frame of memory.
§Safety
The implementer of this trait must guarantee that the allocate_frame
method returns only unique unused frames. Otherwise, undefined behavior
may result from two callers modifying or deallocating the same frame.
Required Methods§
fn allocate_frame(&mut self) -> Option<PhysFrame<S>>
fn allocate_frame(&mut self) -> Option<PhysFrame<S>>
Allocate a frame of the appropriate size and return it if possible.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl FrameAllocator<Size4KiB> for BuddyFrameAllocator
Available on x86-64 only.