For PG3, don't try to allocate the actual space for memory. Simulate this instead with a free space list. Let's say I'm given 1000 bytes to play with. Store that as an ordered pair: (0,999) meaning my free space begins at zero and ends at 999. If someone allocates 10 bytes, my free space now looks like (10,999). If someone allocates another 10 bytes, my free space now looks like (20,999). If the first 10 bytes are freed, my free space list looks like (0,9) --> (20,999). That --> represents a pointer. Each entry points to the next one in the list. If the second ten bytes are freed, then my list looks like (0,9) --> (10,19) --> (20,999) BUT when a segment is freed, I check to see if it can be coalesced with the space on the left, the space on the right, or both, and it can be giving me (0,999). If I have a segment of free space (l,r), the number of available bytes is r-l+1. Now, everytime I allocate a block, I add it to the used space list. The used space list starts out empty. The only difference between the used space list and the free space list is that we don't coalesce segments in the used space list. (0,9)-->(10,19) doesn't merge, because they are two separate allocations and they will need to be deallocated separately. In an object-oriented language, I distinguish between a LinkedList and a LinkedListNode. Maybe in C, try this. typedef struct segment { int first,last; struct segment *next; } segment; segment *freelist, *usedlist; if (freelist != NULL) { segment *P = freelist; while (P->next != NULL) P = P->next; P = malloc (sizeof (segment)); <== This is C for new segment() } else freelist = malloc (sizeof (segment)); When you're done with a segment, then free (segment) will get rid of it. Cascading delete does not happen in C. There are no destructors (or constructors) in C. If you want to deallocate a lot of crap, you gotta do it yourself.