How does a stack memory increase?

后端 未结 3 1939
终归单人心
终归单人心 2021-01-22 23:53

In a typical C program, the linux kernel provides 84K - ~100K of memory. How does the kernel allocate more memory for the stack when the process uses the given memory.

I

3条回答
  •  天涯浪人
    2021-01-23 00:01

    The stack can only be used up to a certain length, because it has a fixed storage capacity in memory. If your question asks in what direction does the stack being used up? the answer is downwards. It is filled down in memory towards the heap. The heap is a dynamic component of memory by which it can actually grow from the bottom up, based on your need of data storage.

    enter image description here

提交回复
热议问题