edited by
818 views
2 votes
2 votes
Which of following is correct?

1). Drawback with static allocation is that it does not support recursion.

2). Drawback with stack allocation is that, when function completes its execution it will be popped out from stack..

3). Both are correct

4).None of above
edited by

1 Answer

Best answer
4 votes
4 votes
1. is correct and recursion can never be done with static allocation.

2. is a bit ambiguous. But assuming a functional language feature, this is also true. In order to return a function, its activation record must be alive even after function run. So, activation record is created on heap and not on stack for these languages.
selected by

Related questions

9 votes
9 votes
1 answer
2
papesh asked Dec 17, 2016
1,926 views
$x=5$$x=x-3$$\textbf{if } x<3$$\quad y=x*2$$\quad w=y$$\textbf{else}$$\quad y=x-3$$w=x-y$$z=x+y$Give Equivalent SSA.