Background:
The standard C library routines malloc() and free()
are used to manage the heap for dynamic allocation of objects used by
C programs. They sit under the object model of C++ as well. Look
them up online using the command man malloc.
The Assignment:
-
Implement mymalloc() and myfree(), with user
interfaces compatible with the predefined heap manager.
In addition, you should write a parameterless initializer, myinit(),
to initialize any data structures your heap manager needs to initialize.
You are free to
use any boundary tag or buddy system implementation, so long as it
allocates memory from an array of 10,000 bytes (or 2,500 32-bit words).
In the event that there is no available free block, your manager must
return NULL without damage to the heap.
-
You should test your heap manager and verify that it works using your
solution to MP3, but the test code should not be included in your code.
Therefore, the subroutines
mymalloc(), myfree() and
myinit() must not be static, so we can link to and call them.
-
Submit your tested work using the
icon
submit mechanism.