Why value-types are stored onto Stacks?
问题 Why does C# (.Net) prefer stack to store value types? What is the primary reason behind this design? Is it because read/write operations to the stack take better advantage of the machine processor? Also, maybe you can justify why not others? 回答1: Eric Lippert discusses this here; firstly, it is incorrect that "value types are stored on the stack". They sometimes are, but not as: fields on a class captured variables variables in an iterator block When they can be stored on the stack it is a