Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?




AFAIK 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.


no escape analysis in .NET, yet, it is coming. set


I 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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: