Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

Identify the risks associated with not planning.

Answered: 1 week ago