免费堆和堆之间有什么区别 [英] What is the difference between Heap and free store

查看:83
本文介绍了免费堆和堆之间有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

Heap和免费存储的详细区别是什么?也请告诉

我可以了解有关堆和堆栈的详细信息.

在此先感谢

Hi all,

What is the difference between Heap and free store in detail.Also please tell

me the details about Heap and stack.

Thanks in advance

推荐答案

堆和免费存储是同一回事.

:内存存储可在运行时用于动态内存分配.如果您的操作系统支持虚拟内存或计算机可用的RAM,则此大小与虚拟内存系统一样大.

堆栈:在这种情况下,更合适的名称是调用堆栈".这比跟踪程序执行链的堆要少得多.每个函数调用将在堆栈上添加一个堆栈框架,并随着每个嵌套函数调用的增长而不断增长.当函数调用返回时,弹出堆栈框架.函数的局部变量与基于堆栈的内存一起分配.当您到达当前调用堆栈的已分配空间的末尾时,就会发生堆栈溢出.
Heap and Free-Store are the same thing.

Heap: Memory store available for dynamic memory allocation at run-time. This is as large as your virtual memory system if your os supports virtual memory, or the available RAM for your machine.

Stack: In this context, the more appropriate name is "Call Stack". This is a much smaller amount of memory than the Heap, which keeps track of the program execution chain. Each function call will add a stack frame on the stack and continue to grow with each nested function call. As function calls return, stack frames are popped off. local variables for functions are allocated with the stack based memory. A stack overrun occurs when you reach the end of the allocated space for the current call stack.


区别是食物和免费午餐之间的差异. :-)
笑话之外:同样,请参见 http://en.wikipedia.org/wiki/Free_store_%28programming%29 [ ^ ].

我真的不能告诉您有关堆和堆栈的详细信息".两者都是编程中的基本概念,因此它们不是任何技术知识的一部分.它们是教育的一部分.我可以很快写一遍,但这没有任何意义:那将是超出CodeProject Questions& amp;的格式的整篇文章.回答,没有认真的实践练习,您将不会真正理解它.基于相同的原因,我不想给您参考.您真的想读一本书并解决一些相关问题.

真的,如果您不了解这些概念和用法,就不会做真正的编程,也不会像被蒙住眼睛那样做.

—SA
The difference is the same as between food and free lunch. :-)
Beyond jokes: same thing, see http://en.wikipedia.org/wiki/Free_store_%28programming%29[^].

I cannot really tell you "detail" about heap and stack. Both are so fundamental concepts in programming, so they are not a part of any technical knowledge. They are part of education. I could quickly write about it, but it makes no sense: it would be a whole article beyond the format of CodeProject Questions & Answers, and you would not really understand it without serious practical exercise. By the same reason I don''t want to give you references. You really want to read a book and solve some related problems.

Really, if you don''t understand these concept and usage, you do not do real programming, or do it like you were blind-folded.

—SA


您可以使用以下链接获取有关堆和堆栈的详细信息.

http://www-cs-faculty.stanford .edu/〜eroberts/courses/cs106b/handouts/25-heap-stack-diagrams.pdf [ http://www.maxi-pedia.com/what+is+heap+and+stack [ ^ ]

http://wiki.answers.com/Q/What_is_difference_between_heap_memory_and_stack_memory [
You can use following link to get details about heap and stack.

http://www-cs-faculty.stanford.edu/~eroberts/courses/cs106b/handouts/25-heap-stack-diagrams.pdf[^]

http://www.maxi-pedia.com/what+is+heap+and+stack[^]

http://wiki.answers.com/Q/What_is_difference_between_heap_memory_and_stack_memory[^]


这篇关于免费堆和堆之间有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆