C program storage space layout

xiaoxiao2021-03-06  122

The C program has been consisting of the following parts:

1) Text section - CPU execution machine; one program has only one copy; read-only, preventing procedures to modify its own instructions due to accidents; 2) Initialization data segment (data segment) - all assigned in the program The global variable of the value is stored here. 3) Non-initialization data segment (BSS segment) - There is no global variable in the program; the kernel initials this segment into 0.4) stack-growth direction: from top-down, automatic variable and each function call The information you need to save (return the address; environmental information). 5) Heap - Dynamic storage.

| ----------- || || ----------- || Stack | | ---------- || | | | / | / || || || / | / || | | | ---------- || Heap || ----------- || Not initialization || ---- ------- || Initialization || ----------- || Text || ----------- |

转载请注明原文地址:https://www.9cbs.com/read-126183.html

New Post(0)