Is there any reason why the heapblock doesn’t have a size member ?
From what I understand, in order to use both realloc, and/or allocate, you need a size variable in your class in addition to the heap block, so you have to store the allocated size in the same level as the heap block.
To me, it’s a bit opposite to OOP.
What about adding a “const int size() const throw()” method for fetching this ?
Also, it would be faster because you can avoid (slow) free’ing the block in case the new size match the previous one (or is less than the previous one depending on if you allow changing semantic).
Maybe I’m preaching for the actual MemoryBlock ?