Added the HeapAlloc function.