![]() ![]() This method is recursive, meaning that it calls itself. The stack logically grows and shrinks as a function is entered and exited.Ĭonsider the following method: public static int Factorial (int x) The stack is a block of memory for storing local variables and parameters. ![]() And perhaps the best one: The Truth About Value Types.The Stack Is An Implementation Detail, Part Two.The Stack Is An Implementation Detail, Part One.Of course, I would be remiss if I didn't link to Eric Lippert's posts on the topic: If it's created by unsafe or unmanaged code, it could be allocated in any type of data structure (not necessarily a stack or a heap).If it's used in an iterator or async block, it will end up on the heap.If it's captured by a closure, it will end up on the heap.If it's a static variable, it will end up on the heap. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |