Skip to content

Commit

Permalink
Implements a mapper with a function to process all addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronan Souza committed May 28, 2019
1 parent 604f8e2 commit 94a7837
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lab_mem/memory_management/Mapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import sys

class Mapper:

def processAddrs(self):
for line in sys.stdin:
v_addr = int(line, 16)
if v_addr < 0:
return
address, n_page_faults = self.map(v_addr)
sys.stdout.write(str(address)+" "+str(n_page_faults)+"\n")

def map(self, addr):
return (addr, 0)

0 comments on commit 94a7837

Please sign in to comment.