Question: You are to write two memory allocation routines to implement Knuth's boundary - tag method. You should write the routines in C using the default

You are to write two memory allocation routines to implement Knuth's boundary-tag method. You should write the routines in C using the default 64-bit (8-byte) pointers of gcc, with allocations made in 16-byte increments. You should use an integrated, doubly-linked free list. On allocate, use the first-fit policy to choose a free block. If the block is large enough, split from the bottom of the free block, leaving a smaller free block in the free list. On release, return the free block to the head of the free list and perform coalescing with adjacent blocks when possible. (The list is doubly-linked so that you can easily remove a free block when you allocate a complete block and when you coalesce a returned block with two adjacent free blocks.)
Your routines will manage a fixed-size region of memory for allocation and release requests. Your two routines are not allowed to call malloc(), sbreak(), or any other system routine to allocate memory on your behalf. The fixed-size region of memory you manage will be made available to your routines as a set of blocks on the free list, and a pointer to the header node of the free list will be available as the global variable "free_list".
The skeleton of the program is provided as alloc.c Download alloc.cin the files section of the Canvas site for the course. The comments in the skeleton discuss the project requirements in more detail.
Turn in a completed program with the name alloc.c using Gradescope

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!