Inside .NET - What is MaxStack for?

Every method defined in .NET has a header, and in this header is a maxstack

value:

.assembly Hello {}
.method public static void Main() cil managed
{
  .entrypoint
  .maxstack 1
  ldstr "Hello, world!"
  call void [mscorlib]System.Console::WriteLine(string)
  ret
}

It is specified explicitly in a fat (Microsoft's naming, not mine) header, and is implicitly 8 in a tiny header.

where to watch the whole patton film

But what is it for?

Well, the documentation states that it specifies the maximum number of entries the stack will contain during execution of this function.

the sicilian official trailer

Good, excellent, very useful, you might think - now the JIT/execution engine doesn't have to figure out how much stack space to allocate, just use this value.

movie net the dark knight
watching requiem for a dream online

But no, it's not that simple. Maxstack

specifies the maximum number of stack entries

download not another teen movie film in ipod formats

, not the maximum number of stack bytes. In .NET the size of a stack entry is essentially unbounded, as value-types are stored directy on the stack; unlike reference types, which have a reference (of known size) stored in the stack.

A value-type can be as large as you like: System.Drawing.Rectangle is 16 bytes, and you can define your own to be multiple kilobytes, or larger (I'm not saying this is recommended, but it's certainly possible).

where can i download shredderman rules online

download hd to kill a mockingbird
dvd a streetcar named desire download

This means that Dot Net Anywhere has to do a full stack analysis of each method to calculate the number of bytes required for the stack, and essentially ignores the maxstack value (it actually does use it, but not for anything important, and could easily manage without - see the source for details - JIT.c).

Which makes me wonder - why is it even there?

high quality the name of the rose movie

It appears to serve no useful purpose.

If you happen to know the answer, please let me know...

hd quality christmas town watch

Comments are closed.