In C#, what is an execution frame (also related to this I have heard of activation frame). IIRC it is a slot where method parameters go but cannot remember all of the details.
Thanks
A code block is executed in an execution frame. A frame contains some administrative information (used for debugging) and determines where and how execution continues after the code block's execution has completed.
"Execution frame" is a term that is used in interpreted languages, Python in particular. That's a very different execution model from C#. The closest equivalent is a scope block in a C# method, a chunk of code that is is bracketed with curly braces.
"Execution frame" is a term that is used in interpreted languages, Python in particular. That's a very different execution model from C#. The closest equivalent is a scope block in a C# method, a chunk of code that is is bracketed with curly braces. Although a Python execution frame could also extend to the body of a function, now it's equivalent to a stack frame in C#. Which is another term for an activation frame.
The C# compiler recognizes declarations that are local to a scope block in C#. The runtime doesn't, it only recognizes a stack frame that's active for the life of the entire method. The difference is trivially papered-over by the compiler by simply declaring the sum of all local variables in all scope blocks as the activation frame. That's a luxury that a Python interpreter cannot afford.
I believe you're referring to a stack frame - in which case the answer is not specific to C# or indeed to any particular language, but rather to the platform that your program is executing on. From the Wikipedia article on the Call Stack:
A call stack is composed of stack frames (sometimes called activation records). These are machine dependent data structures containing subroutine state information. Each stack frame corresponds to a call to a subroutine which has not yet terminated with a return.
See also this answer to a previous question for an excellent description of the stack, including stack frames.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With