动态分区存储管理方式的算法模拟

时间:2013-06-06 05:28:05
【文件属性】:
文件名称:动态分区存储管理方式的算法模拟
文件大小:12KB
文件格式:TXT
更新时间:2013-06-06 05:28:05
动态分区存储管理方式的算法模拟 c语言写的程序 #include #include #include /*库函数*/ #define MAXSIZE 1000 /*最大内存容量*/ #define MINSIZE 1 /*允许最小的碎片*/ #define LEN sizeof(struct Mem_list) void display(); void menu_choice(); void mem_allocation(); int check_num(int n); void error_message(int n); void temp(); void mem_combine(); void move_disk(); void mem_recycle(); void dis_MAT(); /*函数说明*/ typedef struct Mem_list { int num; int status; float size; float addr; struct Mem_list *next; }ML,*MLP; MLP u_lst,f_lst; void main() /*主函数*/ { f_lst=(ML *)malloc(LEN); u_lst=(ML *)malloc(LEN); /*初始化*/ u_lst->next=NULL; u_lst->num=0; u_lst->size=0; u_lst->addr=0; u_lst->status=1; f_lst->num=0; f_lst->size=MAXSIZE; f_lst->addr=0; f_lst->status=0; f_lst->next=NULL; display(); menu_choice(); return; } void display() /*菜单显示函数*/ { printf("\n===============MemoryFunction-Munu================\n"); printf("1. Memory Allocation "); printf("2. Memory Recycle\n"); printf("3. Display MAB"); printf("4. Memory Combine\n"); printf("5. Clear_Screen&Display_menu "); printf("6. Quit\n"); return; }

网友评论

  • 如果有个图像界面的代码 更好