Run time Environment
Storage Allocation Strategies : There are three type Storage Allocation Strategies
i) Static Allocation
ii) Stack Allocation
iii) Heap Allocation
1) Static Allocation : i) Allocation is done at Compile Time
ii) Binding Do not Change at run time
iii) one activation record per procedure
Disadvantage : i) Recursion is not supported
ii) size of data object must be known at compile time
iii) data structure can not be created dynamically
2) Stack Allocation : i) whenever a new activation begin activation record is pushed on to the stack and whenever activation ends, activation record is popped off. local variable are bound to fresh storage.
disadvantage : local variable can not be retained once activation end
3) Heap allocation : allocation and Deallocation can be in any order
Disadvantage : Heap Management is Overhead
Summary : activation can have
i) permanent lifetime of static Allocation
ii) Nested lifetime in static Allocation
iii) arbitrary Lifetime Heap Allocation
Disadvantage : Heap Management is Overhead
Summary : activation can have
i) permanent lifetime of static Allocation
ii) Nested lifetime in static Allocation
iii) arbitrary Lifetime Heap Allocation
Comments
Post a Comment