Derive Copy and Clone for Page and add a Frame::clone method

master
Philipp Oppermann 8 years ago
parent bb3f17c0b9
commit 1f1f6c62da

@ -19,6 +19,10 @@ impl Frame {
fn start_address(&self) -> PhysicalAddress {
self.number * PAGE_SIZE
}
fn clone(&self) -> Frame {
Frame { number: self.number }
}
}
pub trait FrameAllocator {

@ -11,6 +11,7 @@ const ENTRY_COUNT: usize = 512;
pub type PhysicalAddress = usize;
pub type VirtualAddress = usize;
#[derive(Debug, Clone, Copy)]
pub struct Page {
number: usize,
}

Loading…
Cancel
Save