(&mut self)
| 60 | } |
| 61 | } |
| 62 | fn alloc(&mut self) -> Option<PhysPageNum> { |
| 63 | if let Some(ppn) = self.recycled.pop() { |
| 64 | Some(ppn.into()) |
| 65 | } else if self.current == self.end { |
| 66 | None |
| 67 | } else { |
| 68 | self.current += 1; |
| 69 | Some((self.current - 1).into()) |
| 70 | } |
| 71 | } |
| 72 | fn dealloc(&mut self, ppn: PhysPageNum) { |
| 73 | let ppn = ppn.0; |
| 74 | // validity check |