Monday, November 16, 2009

Distinct memory areas in C++

Const data:
stores string literals and other data whose values are known at compile time
No objects of class type will be sotred in const data area
Available during entire lifetime of the program
read only
stack
Const Data
Stores string literals and other data whose values are known at compile time
No objects of class type
Available during entire lifetime of the program
read-only data?

free store
heap
free store and heap should not be two different memory areas; but heap is the data
model to implement the abstract type free-store. almost those terms are
interchangeable.

Global/Static
Storage allocated at program startup.
May not be initialized until after program has started execution.
The order of initialization of global variables across translation units is not defined.
Object access rules as are of Free Store.

No comments: