Question: Program description: it has to be first fit algorithm Sample program to test our functions Write a collection of C functions that provide the functionality
Write a collection of C functions that provide the functionality of a heap manager These are the functions that you should provide: void heap_init(int num pages for heap) void heap_alloc(int num bytes to allocate) void heap_free(void "pointer to area to free) I will write a set of test programs which invoke your functions. The program must manage the space in a set of pages which you obtain via the mmap system call. It should use the first-fit algorithm to allocate new space The program must align requests on 16-byte addresses The program will need to maintain data structures that minimally keep track of blocks of free space. These data structures should NOT be in the allocated pages themselves If the user frees two blocks of memory that are adjacent, your program should coalesce them. If the user attempts to allocate more space than is available in an open free block, then heap alloc should return NULL
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
