edited by
1,481 views
2 votes
2 votes

Consider the following two statements$:$
 $S_{1}:$ Activation records can have a permanent lifetime in case of static allocation.
$S_{2}:$ Activation records can have nested lifetime in case of stack allocation.
Which of the option is correct regarding $S_{1}$ and $S_{2}$ respectively

  1. True, True
  2.  True, False
  3.  False, True
  4.  False, False
edited by

4 Answers

3 votes
3 votes

Activation records have Permanent Lifetime in case of Static Allocation, 
bcoz in case of Static Allocation, Activation records r fixed in static memory area so why it supports function calling but not recursion
Nested Lifetime in case of Stack Allocation
bcoz in case of Stack Allocation, Activation record are pushed into stack area during function call or recursion nd popped out on function return. so why these r nt permanent
Hence ans is A

1 votes
1 votes

Activation records have Permanent Lifetime in case of Static Allocation, Nested Lifetime in case of Stack Allocation and Arbitrary Lifetime in case of Heap Allocation.

So, option A.

1 votes
1 votes

Activation Record has 3 kind of allocation

1)Static allocation

2)Stack Allocation

3) Heap Allocation

Static Allocation means it is in a fixed location of memory. Doesnot change when program executes.No change required at runtime.

Stack Allocation means it works like LIFO. So, requires recursive function calls

Link

0 votes
0 votes
b)Stack/Heap allocation is used in dynamic storage allocation , also recursion is supported here which means there will each activation record for each procedure call i.e. nested ARs so as each procedure completes its work its AR  gets deleted.

Moreover there is dynamic chain which provides stack nature of Activation Record

a) Activation Records are created at compile time and in static allocation method and are removed when programme is over(or after running garbage collector) So we can say that ARs have permanent lifetime.

here permanent means during all course of programme running.

Related questions

1 votes
1 votes
1 answer
2
sripo asked Nov 3, 2018
2,081 views
Does Heap Allocation support both recursion and dynamic memory allocation? Because,a stack can be implemented using dynamic memory allocation.Please correct me.Test Serie...
1 votes
1 votes
1 answer
4
thor asked Nov 17, 2016
385 views
I searched a lot and tried understanding access link in activation record, but didn't get very far. Please explain?Access link points to activation record associated with...