堆和栈有何区别,它们分别位于何处?
- 内容介绍
- 文章标签
- 相关推荐
本文共计4636个文字,预计阅读时间需要19分钟。
英文原文:What and where are the stack and heap? Problem description: In programming language books, it is commonly explained that value types are created on the stack, and reference types are created on the heap. However, is there any explanation of what this stack and heap are?
简化版:What are the stack and heap? In programming books, it's said that value types are on the stack and reference types are on the heap. But what exactly are the stack and heap?
英文原文:What and where are the stack and heap?
问题描述
编程语言书籍中经常解释值类型被创建在栈上,引用类型被创建在堆上,但是并没有本质上解释这堆和栈是什么。我仅有高级语言编程经验,没有看过对此更清晰的解释。我的意思是我理解什么是栈,但是它们到底是什么,在哪儿呢(站在实际的计算机物理内存的角度上看)?
答案一
栈是为执行线程留出的内存空间。
本文共计4636个文字,预计阅读时间需要19分钟。
英文原文:What and where are the stack and heap? Problem description: In programming language books, it is commonly explained that value types are created on the stack, and reference types are created on the heap. However, is there any explanation of what this stack and heap are?
简化版:What are the stack and heap? In programming books, it's said that value types are on the stack and reference types are on the heap. But what exactly are the stack and heap?
英文原文:What and where are the stack and heap?
问题描述
编程语言书籍中经常解释值类型被创建在栈上,引用类型被创建在堆上,但是并没有本质上解释这堆和栈是什么。我仅有高级语言编程经验,没有看过对此更清晰的解释。我的意思是我理解什么是栈,但是它们到底是什么,在哪儿呢(站在实际的计算机物理内存的角度上看)?
答案一
栈是为执行线程留出的内存空间。

