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.