3 ms·
That's crazy! I always thought objects were stack allocated by default unless escape analysis showed them to escape the function return. Goes to show how little
by nothrabannosir 10y ago
That's crazy! I always thought objects were stack allocated by default unless escape analysis showed them to escape the function return. Goes to show how little I know about .Net memory allocation..
Could you elaborate on what the problems would be with storing on the stack? I'm oblivious to what the problem would be. Stack relocation?
- thomasz 10y agoAFAIK no .net JIT does do escape analysis, at all. It's less of a problem than you might think because value types are allocated on the stack anyways.
- jackmott 10y agono escape analysis in .NET, yet, it is coming. set
- moomin 10y agoI wouldn't hold out too much hope. Java always intended for escape analysis to remove the need for value types. Now they're adding value types.