The most general dynamic allocation facility is malloc
. It allows you to allocate blocks of memory of any size at any time, make them bigger or smaller at any time, and free the blocks individually at any time (or never).
Basic Allocation | Simple use of malloc . |
Malloc Examples | Examples of malloc . xmalloc . |
Freeing after Malloc | Use free to free a block yougot with malloc . |
Changing Block Size | Use realloc to make a blockbigger or smaller. |
Allocating Cleared Space | Use calloc to allocate ablock and clear it. |
Efficiency and Malloc | Efficiency considerations in use of these functions. |
Aligned Memory Blocks | Allocating specially aligned memory:memalign and valloc . |
Heap Consistency Checking | Automatic checking for errors. |
Hooks for Malloc | You can use these hooks for debugging programs that use malloc . |
Statistics of Malloc | Getting information about how much memory your program is using. |
Summary of Malloc | Summary of malloc and related functions. |