Inside .NET - What is MaxStack for?

March 13th, 2009

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

Refresh

March 10th, 2009

If you've been here before, you'll notice that Dot Net Anywhere now has a refreshingly new website.

noelle the film in hd

OK, it's pretty simple, but definitely better than before.

paths of glory download full film
romeo must die movie download link

Regretfully, the Dot Net Anywhere software hasn't been updated for an embarressingly long time, hopefully this will be rectified sometime in 2009 (but don't hold your breath...).

download the goodfellas
spider movie hd download

desperate hours review film

watch full double jeopardy film in hd
cyrus film on the internet

buy the film cats & dogs: the revenge of kitty galore
smile pretty full movie