Create an EmptyFrameAllocator

This commit is contained in:
Philipp Oppermann
2019-03-13 14:30:13 +01:00
parent 6146ccba2d
commit 3e59283c19

View File

@@ -54,3 +54,12 @@ pub fn create_example_mapping(
let map_to_result = unsafe { mapper.map_to(page, frame, flags, frame_allocator) };
map_to_result.expect("map_to failed").flush();
}
/// A FrameAllocator that always returns `None`.
pub struct EmptyFrameAllocator;
impl FrameAllocator<Size4KiB> for EmptyFrameAllocator {
fn allocate_frame(&mut self) -> Option<PhysFrame> {
None
}
}