You can create additional heaps in your process by having a thread call
HANDLE HeapCreate( DWORD fdwOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);
The first parameter,
fdwOptions, modifies how operations are performed on the heap. You can specify
HEAP_CREATE_ENABLE_EXECUTE, or a combination of these flags.
By default, a heap will serialize access to itself so that multiple threads can allocate and free blocks from the heap without the danger of corrupting the heap. When an attempt is made to allocate a block of memory from the heap, the
HeapAlloc function (discussed later) must do the following:
Traverse the linked list of allocated and freed memory ...