C
CANCER.0707
The problem statement is as follows
Create a library that creates pools of memory of different sizes.For
e.g. one pool of 32 byte size, another pool of 64 byte size and so
on.Create an array of pointers and store the pointer to each pool in
this array.Each pool maintains one link list of free pointers and
another link list of allocated pointers.Whenever, the main program
requests for a memeory of say, size 32 bytes, a pointer is returned
from the free list of 32-byte pool and that pointer is moved to
allocated list.Whenever the main program requests for freeing this
memory, the pointer will be returned back to the 32 byte size free
pool.Write both the memory manager and main program that uses it.
Create a library that creates pools of memory of different sizes.For
e.g. one pool of 32 byte size, another pool of 64 byte size and so
on.Create an array of pointers and store the pointer to each pool in
this array.Each pool maintains one link list of free pointers and
another link list of allocated pointers.Whenever, the main program
requests for a memeory of say, size 32 bytes, a pointer is returned
from the free list of 32-byte pool and that pointer is moved to
allocated list.Whenever the main program requests for freeing this
memory, the pointer will be returned back to the 32 byte size free
pool.Write both the memory manager and main program that uses it.