C execution: Memory
An executing C program partitions memory into:
- code … fixed-size, read-only region
- contains the machine code instructions for the program
- global data .. fixed-size, read-write region
- contain global variables and constant strings
- heap … very large, read-write region
- contains dynamic data structures created by
malloc() (see later)
- stack … dynamically-allocated data (function local vars)
- consists of frames, one for each currently active function
- each frame contains local variables and house-keeping info
|