IOS miscellaneous pen-17 (stack area, etc.), ios-17

Source: Internet
Author: User

IOS miscellaneous pen-17 (stack area, etc.), ios-17

Stack): Automatically assigned by the system. It generally stores function parameter values and local variable values. Automatically created and released by the compiler. Its operation method is similar to the stack in the data structure, that is, the principle of first-in-first-out and first-out.

For example, declare a local variable int B in the function, and the system automatically opens up space for B in the stack.

Heap): Generally, the programmer requests and specifies the size, and finally releases the package. If the programmer does not release the program, it may be recycled by the OS at the end of the program. The management of the heap area is linked. The operating system has a linked list that records the idle memory address. When receiving the application for memory allocation by the program, the operating system will traverse the linked list, traverse to a linked list node whose memory address is greater than the requested memory, and delete the node from the linked list, then allocate the memory address recorded by the node to the program.

Global/static: as the name suggests, global and static variables are stored in this area. Only initialized global variables and static variables are stored in one block, while uninitialized global variables and static variables are stored in one block. The program is released by the system.

Text Constant Area: This area mainly stores string constants. The program is released by the system.

Code area: This area stores the binary code of the function body.

Related Article

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.