In the last chapter in the book, we will implement our own memory allocation routine. We won’t implement the full generality of malloc() and friends. There is rarely a need to try to replicate something we already have code for, presumably optimized and thoroughly tested. Instead, we will implement allocation routines optimized for cases where we need to allocate many equally sized objects, and here we can improve upon the performance of the general code that needs to handle the allocation of objects of any size.
There is some overhead to allocating memory, even though malloc() is usually ...