Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following best describes the relationship between activation records and the call stack ?

  • A.Activation records are stored in a heap, and the call stack is used for control flow
  • B.Activation records are stored in call stack, representing the sequence of function calls
  • C.Activation records are managed globally, and the call stack is used for loop constructs
  • D.Activation records and call stack are unrelated concepts in memory management

Answer: B

Activation records are stored in the call stack, representing the sequence of function calls.

Each time a function is called, an activation record (stack frame) holding its parameters, return address, saved registers and local variables is pushed onto the call stack; it is popped when the function returns. The stack of frames therefore records the chain of active calls, which also makes recursion possible.

Activation records are not normally kept in the heap or managed globally, the call stack is not for loop constructs, and the two concepts are closely related, not unrelated.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.