Пример #1
0
 public static void deallocatePcb(PCB pcb)
 {
     if (pcb.getProcessStatus() == PCB.PROCESS_STATUS.TERMINATE)
     {
         int startingVirtualPageNum = Helpers.getPageNumberFromAddress(pcb.getJobMemoryAddress());
         for (int i = 0; i < pcb.getAllocatedVirtualPages().Capacity; i++)
         {
             int virtualPageNum  = pcb.getAllocatedVirtualPages()[i];
             int physicalPageNum = _pageTable[virtualPageNum];
             _memBlock[physicalPageNum] = null;
             _pageTable[virtualPageNum] = -1;
         }
     }
 }