Skip to content

Commit

Permalink
add todo
Browse files Browse the repository at this point in the history
  • Loading branch information
Rezia23 committed Apr 11, 2021
1 parent 7032ef2 commit b4993a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 2/solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ class CCPUChild : public CCPU {
if(pages < memLimit){
uint32_t numToRemove = memLimit - pages;
uint32_t lastSecondLevelPageNum;
memcpy(&lastSecondLevelPageNum, memory + (m_PageTableRoot * PAGE_SIZE) + (numSecondLevelPageTables-1)*4, 4); //times 4 because one entry is 4 bytes
memcpy(&lastSecondLevelPageNum, memory + calculateAddressShift(m_PageTableRoot, numSecondLevelPageTables-1), 4); //times 4 because one entry is 4 bytes
lastSecondLevelPageNum = lastSecondLevelPageNum >> 12;
//TODO when memLimit is 5000 and we are setting to 2000, numInLastSecondLevelPageTable is 5000 which is some random bullshit
if(numToRemove < numInLastSecondLevelPageTable){
//remove few, set numILSLPT, set memLimit, push to stack
removeFew(lastSecondLevelPageNum, numToRemove, numInLastSecondLevelPageTable, memory);
Expand Down

0 comments on commit b4993a3

Please sign in to comment.