Skip to content

Commit eeb7b63

Browse files
authored
feat: implement Clone for PageTable (#236)
1 parent aab7181 commit eeb7b63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/structures/paging/page_table.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,12 @@ const ENTRY_COUNT: usize = 512;
177177
///
178178
/// This struct implements the `Index` and `IndexMut` traits, so the entries can be accessed
179179
/// through index operations. For example, `page_table[15]` returns the 15th page table entry.
180+
///
181+
/// Note that while this type implements [`Clone`], the users must be careful not to introduce
182+
/// mutable aliasing by using the cloned page tables.
180183
#[repr(align(4096))]
181184
#[repr(C)]
185+
#[derive(Clone)]
182186
pub struct PageTable {
183187
entries: [PageTableEntry; ENTRY_COUNT],
184188
}

0 commit comments

Comments
 (0)