BSS segment in program, data segment, code snippet (. Text), heap (heap), stack (stack)
. BSS segment: Uninitialized and initialized to 0 global variables and static local variables (static) initialized to 0 in the program. Data segment: Non-zero initialized global variables and non-zero initialized static local variables (static) in the programCode Snippet: the place (. Text field) where the code is stored, which cannot be modified and stored in the read-only area. Heap: The area that the programmer himself applies for, that is, the region of memory requested by the malloc () function, and the free () function. Stack: The area where local variables are stored, and local variables in the function are stored in the stack.
Memory block diagram by SRAM we can probably know: the stack in the top area of memory, global variables (data segments) in the middle, (Zi segment) BSS segment and Heap (heap) in the bottom area
Note: We can also write our own code to test how each variable is placed in the area of memory.
This blog is to write code test in which area: http://www.cnblogs.com/joseph-linux/p/3316963.html
Reference Source: Master Zhu's IoT tutorial
BSS segment in program, data segment, code snippet, heap, stack