m = new HeapManager (new int[11]).
Assume that the HeapManager implements best-fit mechanism for allocate and coalescing adjacent free blocks for deallocate.
Also consider a program that needs the following ordered sequence of memory allocation and deallocation service.
a = m.allocate(3);
b = m.allocate(1);
c = m.allocate(2);
d = m.allocate(1)
m.deallocate(a);
m.deallocate(d);
e = m.allocate(1);
m.deallocate(b);
m.allocate(5);
Is the HeapManager able to fulfill the above sequence of memory service request? Explain why it is or not.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here