Some advantages of managing your own heap:
- You might be able to optimize very specifically for your own allocation needs and improve performance.
- You may be able to avoid the use of synchronization objects if you know the concurrency rules.
- A single free can release an entire set of allocations. For example, a short lived process that needs a bunch of small allocations that are freed all at once could carve them out of a larger block, which can be freed with a single call later.
The disadvantages, though, are very big. The added complexity will produce more bugs, more difficult maintenance, and quite possibly poorer performance in the end. I have absolutely no data to support this, but I suspect that more home-grown heap management systems result in worse performance than help it.
Some advantages of using the system's allocations (e.g., HeapAlloc):
- Less complexity.
- Reduced risk of concurrency problems in the allocation/freeing.
- The ability to take advantage of the Low-Fragmentation Heap. This already does a very good job in most cases of handling the small allocations very efficiently.