Is there any way to create a heap that is larger than 4 GB using the HeapCreate()
function?
A heap bigger than 4 GB can be achieved by setting the dwMaximumSize
parameter to zero and then asking for memory chunks. But this causes the individual parts of the heap to be split by the MEM_RESERVED
chunks. I would need to create a continuous heap that has 5GB and is not divided by these MEM_RESERVED
chunks.
The HeapCreate()
function's dwMaximumSize
parameter is of the SIZE_T
type, which should allow setting this value to a higher value than 4 GB on a 64-bit system. However, when I try to allocate such a heap (larger than 4GB), HeapCreate()
returns a null pointer. However, I haven't found anywhere documented that the HeapCreate()
function should only allow the allocation of a heap that has dwMaximumSize
parameter less than 4GB.