pub struct PageStackAllocator {
page_stack: &'static mut [u64],
size: usize,
head: usize,
}
Expand description
There should only be one global instance of this.
Fields§
§page_stack: &'static mut [u64]
§size: usize
§head: usize
Implementations§
Source§impl PageStackAllocator
impl PageStackAllocator
const STACK_SIZE: usize = 1_048_576usize
pub fn new() -> Self
Sourcepub fn free_page(&mut self, addr: u64) -> bool
pub fn free_page(&mut self, addr: u64) -> bool
push an addr into the free page stack MUST be atomic or bad things happen…
pub fn alloc_page(&mut self) -> Option<u64>
Sourcepub fn insert_range(&mut self, r: &Range<u64>) -> u64
pub fn insert_range(&mut self, r: &Range<u64>) -> u64
4k page only?