📄 bit-vect.c
字号:
#include "fs.h"// member functions for BitVectvoid BitVect_init(struct BitVect *v){//make all bits free initially int i; for(i=0;i<BVSIZE;i++) v->vect[i]=0;}int BitVect_get_free_bit(struct BitVect *v){// find free bit int i; for(i=0;i<BVSIZE;i++) // if (v->vect[i]==0) { v->vect[i]=1; // mark it return i; } panic("no more free bit");}void BitVect_set_bit(struct BitVect *v,int x){ v->vect[x]=1;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -