October 2010
Intermediate to advanced
1552 pages
45h 39m
English
Many system programs need to be able to allocate extra memory for dynamic data structures (e.g., linked lists and binary trees), whose size depends on information that is available only at run time. This chapter describes the functions that are used to allocate memory on the heap or the stack.
A process can allocate memory by increasing the size of the heap, a variablesize segment of contiguous virtual memory that begins just after the uninitialized data segment of a process and grows and shrinks as memory is allocated and freed (see Figure 6-1 on page 119). The current limit of the heap is referred to as the program break.
To allocate memory, C programs normally use the malloc family of functions, ...
Read now
Unlock full access