Question: C Before starting this assignment, it is recommended to have some basic idea about dynamic memory allocation, implicit free lists (section 9.9.6) and policy for

C

C Before starting this assignment, it is recommended to have some basic

idea about dynamic memory allocation, implicit free lists (section 9.9.6) and policy

Before starting this assignment, it is recommended to have some basic idea about dynamic memory allocation, implicit free lists (section 9.9.6) and policy for placing allocated blocks section 9.9.7) In this assignment you have to learn and implement different policies for dynamic memory allocation. These policies are First fit, Next fit and Best fit. When there is any request for dynamic memory allocation to the memory allocator: In the First fit policy, the allocator would search for empty blocks which can fit the request. If it finds one, returns that list. In the Next fit policy, instead of searching from the beginning of the free lists, it would start searching from where the previous search left off. In the Best fit policy, it would search each of the free blocks and return the blocks which fits the request and has the smallest size among all . . . list: the sequence of blocks, which have been used to serve a dynamic memory allocation request. Your custom memory allocator function could be custom_malloc(size, id) and custom_free(id). Where id would be identification number of any malloc request. You can assume that each of your block has the following structure (simple linked list) struct block int id struct block *next_list; /ext start of the other list struct block *next; /ext block int list_size; //the length of the list, if this is the starting block bool has_assigned; //list reserved or not typedef struct block BLOCK For this assignment assume that, your heap size (Total block number) is 100. And initially all of your blocks are empty Now, do the following

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!