don't change counter in set_unused

This commit is contained in:
Robert Węcławski
2017-12-17 18:45:41 +01:00
parent 82bae0b314
commit 2d041bbb51

View File

@@ -29,12 +29,12 @@ pub const COUNTER_MASK: u64 = 0x3ff00000_00000000;
impl Entry {
/// Is the entry unused?
pub fn is_unused(&self) -> bool {
self.0 == 0
self.0 == (self.0 & COUNTER_MASK)
}
/// Make the entry unused
pub fn set_unused(&mut self) {
self.0 = 0;
self.0 = self.0 & COUNTER_MASK;
}
/// Get the address this page references