📄 fifo.h
字号:
#ifndef FIFO_H
#define FIFO_H
#include "fs.h"
void FIFO(total_pf)
int total_pf;
{
int i,j;
pfc_type *p,*t;
initialize(total_pf);
busypf_head=busypf_tail=NULL;
for(i=0; i<total_instruction; i++)
{
if(pl[page[i]].pfn==INVALID)
{
diseffect+=1;
if(freepf_head==NULL)
{
p=busypf_head->next;
pl[busypf_head->pn].pfn=INVALID;
freepf_head=busypf_head;
freepf_head->next=NULL;
busypf_head=p;
}
p=freepf_head->next;
freepf_head->next=NULL;
freepf_head->pn=page[i];
pl[page[i]].pfn=freepf_head->pfn;
if(busypf_tail==NULL)
busypf_head=busypf_tail=freepf_head;
else
{
busypf_tail->next=freepf_head;
busypf_tail=freepf_head;
}
freepf_head=p;
}
}
printf("FIFO:%6.4f",i-(float)diseffect/320);
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -