Data Structures and Algorithms
Memory Allocators

C implementations provide a number of memory allocation functions which allocate memory from the program's heap. This is usually an area of memory above the program and data blocks which grows upwards in memory as memory is allocated by program requests.

The two most commonly used C functions are malloc and calloc.

Full descriptions may be found in the Unix man pages for malloc and calloc.

Fig 1 A typical program's use of memory.

Back to the Table of Contents
© John Morris, 1998