问题:
Programming language books explain that value types are created on the stack , and reference types are created on the heap , without explaining what these two things are. 编程语言书籍解释了值类型是在堆栈上建立的,而引用类型是在堆上建立的,而没有说明这两个是什么。 I haven't read a clear explanation of this. 我尚未阅读清楚的解释。 I understand what a stack is. 我了解堆栈是什么。 But, 但, 编程
- Where and what are they (physically in a real computer's memory)? 它们在哪里和在哪里(物理上在真实计算机的内存中)?
- To what extent are they controlled by the OS or language run-time? 它们在多大程度上受操做系统或语言运行时的控制?
- What is their scope? 他们的范围是什么?
- What determines the size of each of them? 什么决定了它们的大小?
- What makes one faster? 是什么使速度更快?
解决方案:
参考一:
https://stackoom.com/question/Kn5/什么是堆栈和堆
参考二:
https://oldbug.net/q/Kn5/What-and-where-are-the-stack-and-heap