Question: This problem will have you analyze the allocation pattern of a memory allocator to assess how different allocation policies affect where data is allocated and
This problem will have you analyze the allocation pattern of a memory allocator to assess how different allocation policies affect where data is allocated and the corresponding fragmentation.
Assume that memory is word addressed and each word in the diagram below holds a single datum. To simplify the problem, assume there are not "header" and "footer" words and only allocate the words indicated in the call to malloc.
The heap is shown below and it is initially empty. See Image to see the possilbe answers for each part. Note that all parts of the question have the same set of answer options so the list in the image is what is avaible for abc& d
a If the heap is using the first fit policy in allocating blocks, what is the value of p after instruction th execution?
b If the heap is using the best fit policy in allocating blocks, what is the value of p after instruction th execution?
c If the heap is using the best fit policy in allocating blocks, what is the value of p after instruction th execution?
d If the heap is using the best fit policy in allocating blocks, what is the value of p after instruction th execution?
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
