previous | start | next

Sample Implementations: mm_malloc, mm_free

A reasonably good initial implementation of malloc, mm_malloc is presented in the text with a corresponding implementation of mm_free.

The mm_free implementation is super fast!

But...

The reason is that mm_free simply does nothing!

So whenever no free block is available of the correct size, mm_malloc must increase the size of the heap segment.

This implementation is fast, but does a poor job of handling the external fragmentation problem and provides very inefficent management of the heap segment size!



previous | start | next