-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOwnSimulation.h
More file actions
36 lines (24 loc) · 791 Bytes
/
OwnSimulation.h
File metadata and controls
36 lines (24 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// Created by Nick Chapman on 4/19/17.
//
#ifndef PAGING_OWNSIMULATION_H
#define PAGING_OWNSIMULATION_H
#include <random>
#include <list>
#include "PagingSimulation.h"
class OwnSimulation : public PagingSimulation {
unsigned int mSinceLastHit = 0;
unsigned int mRandomReplacementsRemaining = 0;
std::mt19937 mt;
std::uniform_int_distribution<unsigned int> dist;
std::list<PageTableEntry*> cacheList;
std::unordered_map<unsigned int, std::list<PageTableEntry*>::iterator> cacheMap;
public:
OwnSimulation();
OwnSimulation(unsigned int nFrames, bool verbose);
void UpdateEntry(PageTableEntry* entry);
PageTableEntry* RemoveFrameEntry();
void AddFrameEntry(PageTableEntry* entry);
void Process();
};
#endif //PAGING_OWNSIMULATION_H