BSS segment in program, data segment, code snippet, heap, stack

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.