Question: ( 3 0 ) Consider a memory allocator with the following properties: Allocations are 4 - byte aligned, for each memory block, either allocated or
Consider a memory allocator with the following properties:
Allocations are byte aligned, for each memory block, either allocated or free
Allocator uses an implicit free list
Allocator uses immediate coalescing, that is adjacent free blocks are merged immediately
each time a block is freed
To find a free block, first fit method is used
The allocated and free blocks both have header and footer
The header and footer use:
the higher order bits to record block size block size includes the header and
footer
the lower order bits to record allocation information:
bit indicates the use of current block: for allocated, for free
bit indicates the use of previous adjacent block: for allocated, for free.
If the heap starts at memory address show the contents of heap after each of the
following requests. Note that the addresses grow from top down.
i Draw the heap
ii Indicate the memory location that and points at
iii. Indicate each memory block either allocated or free.
iv Indicate the blocks that contain header and footer.
v Give the contents of header and footer for each block in hexadecimal Don't forget to
indicate the change in header and footer when there is a need.
amalloc
bmalloc
c free p
dmalloc
e free
f malloc
Show all your work and briefly explain your answer! Your heap will be like the following, and you will draw the heap times ie for each request You
can insert more rows as you need.
Here is an example that shows what you will include in your answer. Note that this example is for a
totally different allocator.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
