一旦内核调度进程执行,它就设置栈和堆,前者从用户空间的顶部向下增长,后者从可执行映像的尾部向上增长。
Once the kernel schedules the process for execution, it sets the stack to grow down from the top of user space, and the heap to grow up from the end of the executable image.
它是别的其他数据区包括环境、进程参数、进程堆、线程栈和线程环境块(TEB)。
Additional data areas it recognizes include Environment, Process Parameters, Process Heap, Thread Stack, and Thread Environment Block (TEB).
回到我们在入门中非常简单的例子上,在下面的的图表中,你可以看到基于栈和基于堆的对象。
Returning to our very simple example, described in Getting Started, in the following diagram you can see the handle-stack and heap-allocated objects.
Now, as an aside, there's another couple of layers at the very top above the stack and above the heap, but below the tech segment and those are called initialized data and uninitialized data.
题外话,在堆和栈的顶端,还有好几层,但是在技术段之下,他们被叫做初始化数据和未初始化数据。
Eventually, stack and heap will collide.
最终,堆和栈会冲突。
应用推荐