Skip to content

Commit

Permalink
feat: implement Clone for PageTable (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
toku-sa-n authored Mar 16, 2021
1 parent aab7181 commit eeb7b63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/structures/paging/page_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,12 @@ const ENTRY_COUNT: usize = 512;
///
/// This struct implements the `Index` and `IndexMut` traits, so the entries can be accessed
/// through index operations. For example, `page_table[15]` returns the 15th page table entry.
///
/// Note that while this type implements [`Clone`], the users must be careful not to introduce
/// mutable aliasing by using the cloned page tables.
#[repr(align(4096))]
#[repr(C)]
#[derive(Clone)]
pub struct PageTable {
entries: [PageTableEntry; ENTRY_COUNT],
}
Expand Down

0 comments on commit eeb7b63

Please sign in to comment.