/* this file is heap.h */ #ifndef _HEAP #define _HEAP #define MAX_MEM 100 /* you might want to change MAX_JOBS to 10 to test your program but be sure to change it back */ #define MAX_JOBS 100 typedef struct mem_slot { int used; int start; int size; int endtime; struct mem_slot *prev; struct mem_slot *next; } MEM_SLOT; void crelist(int *list,int *size, int len); float RANDOM(); int get_jobs(int *times, int *size,int len); MEM_SLOT *FindFirstFit(MEM_SLOT *memory, int size); MEM_SLOT *FindWorstFit(MEM_SLOT *memory, int size); void allocate(MEM_SLOT *memory, int ProcSize, int EndTime); void core_dump(MEM_SLOT *node); void expire_procs(MEM_SLOT *node, int clock); void shrink_mem(MEM_SLOT *node); MEM_SLOT *findnextbusynode(MEM_SLOT *node); #endif