mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Add a Table::zero method to clear all entries
This commit is contained in:
@@ -6,6 +6,14 @@ pub struct Table {
|
||||
entries: [Entry; ENTRY_COUNT],
|
||||
}
|
||||
|
||||
impl Table {
|
||||
pub fn zero(&mut self) {
|
||||
for entry in self.entries.iter_mut() {
|
||||
entry.set_unused();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Index<usize> for Table {
|
||||
type Output = Entry;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user