The GrowHeap function issues a system call to try to increase the size of the memory available to your program. It first tries to increase memory in a 256Kb chunk if the size to allocate is less than 256Kb, or 1024K otherwise. If this fails, it tries to increase the heap by the amount you requested from the heap.
If the call to GrowHeap was successful, then the needed memory will be allocated.
If the call to GrowHeap fails, the value returned depends on the value of the ReturnNilIfGrowHeapFails global variable. This is summarized in table (8.10).
|