diff options
Diffstat (limited to 'fifo.py')
-rw-r--r-- | fifo.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -4,6 +4,7 @@ | |||
4 | # Pacien TRAN-GIRARD et Adam NAILI | 4 | # Pacien TRAN-GIRARD et Adam NAILI |
5 | 5 | ||
6 | from mem import Memory | 6 | from mem import Memory |
7 | from pageexception import * | ||
7 | 8 | ||
8 | 9 | ||
9 | class FifoPaginator: | 10 | class FifoPaginator: |
@@ -18,7 +19,7 @@ class FifoPaginator: | |||
18 | return overwritten | 19 | return overwritten |
19 | 20 | ||
20 | def load(self, page): | 21 | def load(self, page): |
21 | if not self.mem.page_in_range(page): raise IndexError | 22 | if not self.mem.page_in_range(page): raise PageException |
22 | if page in self.mem.main: return | 23 | if page in self.mem.main: return |
23 | if page in self.mem.virt: self.mem.remove_virt(page) | 24 | if page in self.mem.virt: self.mem.remove_virt(page) |
24 | overwritten = self._put_main(page) | 25 | overwritten = self._put_main(page) |