Machine Problem 3, due Mar 24

Part of the homework for 22C:112, Spring 2008
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

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.

In the next machine problem, you will be implementing your own heap, implementing mymalloc() and myfree(), with user interfaces compatible with the predefined heap manager. For this problem, implement these two routines as stubs, where each operates by calling the corresponding built-in routines. Your allocate routine will occasionally return NULL when there is insufficient memory in the heap to allocate new memory.

To test a heap manager, it is useful to have a source of random numbers. The standard C library contains a good random number generator. Look it up online using the command man random.

The Assignment: