You can use XL C/C++ to create and manipulate your own memory heaps, either in place of or in addition to the default XL C/C++ runtime heap.
You can create heaps of regular memory or shared memory, and you can have any number of heaps of any type. The only limit is the space available on your operating system (your machine's memory and swapper size, minus the memory required by other running applications). You can also change the default runtime heap to a heap that you have created.
Using your own heaps is optional, and your applications can work well using the default memory management provided (and used by) the XL C/C++ runtime library. However, using multiple heaps can be more efficient and can help you improve your program's performance and reduce wasted memory for a number of reasons:
With multiple heaps, you can specify the heap from which you want to allocate. For example, you might create a heap specifically for a linked list. The list's memory blocks and the data they contain would remain close together on fewer pages, which reduces the amount of swapping required.
If you create a separate heap for each thread, you can allocate from them concurrently, eliminating both the waiting period and the overhead required to serialize access to the heap.
If you create a separate heap only for that linked list, you can destroy it with a single call and free all the memory at once.
With multiple heaps, you can create a separate heap for each component, so if one damages the heap (for example, by using a freed pointer), the others can continue unaffected. You also know where to look to correct the problem.