void pageit(Pentry q[MAXPROCESSES]) { /* tick starts at 1, so 0 means this is the first run * or an overflow. either way, reset timestamps. */ if(tick < 1) { timestamps_init(); tick = 1; if(atexit(exit_fn) != 0) { perror(NULL); exit(1); } } lru_pageit(q, tick); /* advance time for next pageit iteration */ tick++; }
void pageit(Pentry q[MAXPROCESSES]) { if(tick<1) { int proc,pg; for(proc=0;proc<MAXPROCESSES;proc++) { for(pg=0;pg<MAXPROCPAGES;pg++) timestamps[proc][pg]=0; } tick=1; atexit(term); } lru_pageit(q,tick); tick++; }