aboutsummaryrefslogtreecommitdiff
path: root/secondchance.py
diff options
context:
space:
mode:
Diffstat (limited to 'secondchance.py')
-rw-r--r--secondchance.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/secondchance.py b/secondchance.py
index b0fb1f9..d6617de 100644
--- a/secondchance.py
+++ b/secondchance.py
@@ -1,7 +1,7 @@
1#!/usr/bin/env python3 1#!/usr/bin/env python3
2 2
3# UPEM / Programmation système / Projet : Simulation de gestion de mémoire virtuelle 3# UPEM / System programming / Project: Memory paging simulator
4# Pacien TRAN-GIRARD et Adam NAILI 4# Pacien TRAN-GIRARD, Adam NAILI
5 5
6from mem import Memory 6from mem import Memory
7from pageexception import * 7from pageexception import *
@@ -25,10 +25,9 @@ class SecondChancePaginator:
25 25
26 def load(self, page): 26 def load(self, page):
27 if not self.mem.page_in_range(page): raise PageException 27 if not self.mem.page_in_range(page): raise PageException
28 if page in self.mem.main: 28 if page in self.mem.main:
29 self._check_table[page] = 1 29 self._check_table[page] = 1
30 return 30 return
31 if page in self.mem.virt: self.mem.remove_virt(page) 31 if page in self.mem.virt: self.mem.remove_virt(page)
32 overwritten = self._put_main(page) 32 overwritten = self._put_main(page)
33 if overwritten is not None: self.mem.put_virt(overwritten) 33 if overwritten is not None: self.mem.put_virt(overwritten)
34