Allocating and Freeing Memory

┌─────────────────────────┬──────────────┬─────────────────────────┬───────────┐
│ Function │ Header File │ Link to Function │ Descriptio│
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ calloc │ "stdlib.h"" │ calloc │ Reserves │
│ │ malloc.h" │ │ storage │
│ │ │ │ space for │
│ │ │ │ an array │
│ │ │ │ and ini- │
│ │ │ │ tializes │
│ │ │ │ the │
│ │ │ │ values of │
│ │ │ │ all ele- │
│ │ │ │ ments to │
│ │ │ │ 0. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ free │ "stdlib.h"" │ free │ Releases │
│ │ malloc.h" │ │ memory │
│ │ │ │ blocks. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ _heapmin │ "stdlib.h"" │ _heapmin │ Returns │
│ │ malloc.h" │ │ all │
│ │ │ │ unused │
│ │ │ │ memory │
│ │ │ │ from the │
│ │ │ │ run-time │
│ │ │ │ heap to │
│ │ │ │ the oper- │
│ │ │ │ ating │
│ │ │ │ system. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ malloc │ "stdlib.h"" │ malloc │ Allocates │
│ │ malloc.h" │ │ memory │
│ │ │ │ blocks. │
├─────────────────────────┼──────────────┼─────────────────────────┼───────────┤
│ realloc │ "stdlib.h"" │ realloc │ Changes │
│ │ malloc.h" │ │ storage │
│ │ │ │ size │
│ │ │ │ allocated │
│ │ │ │ for an │
│ │ │ │ object. │
└─────────────────────────┴──────────────┴─────────────────────────┴───────────┘


[Back: Dynamic Memory Management]
[Next: Heap Information and Checking]