Code area
Receiving computer instruction code 只读
area, 共享
, 无法操作
, .
Data area
- Initialize the data area
- Uninitialized data area
- Constant area
Heap area
The heap area stores things that allow users to access at will, generally storing videos, pictures, models, texts, etc., strings, slices, maps, new functions, etc.
Stack area
Stack area to store function information and local variables
Storage principle: first in, last in, last in, first out.
note
- The heap area is much larger than the stack area
- The stack area generally stores data variables of a known size, and the size of map slices etc. needs to be appended, so the size is undetermined.
- Store from low address to high address
- Data area generally refers to global variables
- The lowest address is not the code area, 0-255 is occupied by the system. Similarly, the highest is not the stack area, but the registry
- The stack area is stored from high address to low address
- There is a gc garbage collection mechanism in the stack area, which will maintain itself