What does “Memory allocated at compile time” really mean?

前端 未结 13 1089
时光取名叫无心
时光取名叫无心 2020-12-04 04:30

In programming languages like C and C++, people often refer to static and dynamic memory allocation. I understand the concept but the phrase \"All memory was allocated (rese

13条回答
  •  庸人自扰
    2020-12-04 05:20

    You are right. Memory is actually allocated (paged) at load time, i.e. when the executable file is brought into (virtual) memory. Memory can also be initialized on that moment. The compiler just creates a memory map. [By the way, stack and heap spaces are also allocated at load time !]

提交回复
热议问题