Using the Memory-Allocation Functions

The memory-allocation functions have two common uses:

To shrink a program's initial memory allocation so that there is enough room to load and execute another program under its control.

To dynamically allocate additional memory required by the program and to release the same memory when it is no longer needed.