C# – First steps with C# and .NET – part 034.

The tutorial for today is about StackOverflowException.
The exception is thrown when the execution stack overflows by having too many pending method calls. This class cannot be inherited.
Microsoft intermediate language (MSIL) instruction allocates a certain number of bytes from the local dynamic memory pool and pushes the address (a transient pointer, type *) of the first allocated byte onto the evaluation stack.
The stack transitional behavior, in sequential order, is:

  • the number of bytes to be allocated is pushed onto the stack.
  • the number of bytes is popped from the stack; an amount of memory corresponding to the size is allocated from the local heap.
  • a pointer to the first byte of the allocated memory is pushed onto the stack.

StackOverflowException uses the HRESULT COR_E_STACKOVERFLOW, which has the value 0x800703E9, see the official webpage.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.