Status: Tags: #295/cpu/memory Links: Central Processing Unit (CPU)
Computer Memory
Principles
Storage
- Linear array of bytes
- Smallest adressable is 1 byte / 8 bits
- Each byte has unique adress, byte-adressable
- CPU reads a word a time
Segments
- Memory Stack
- Runtime stack, local variables
- Heap
- Dynamically allocated as needed
- Explicitly released malloc(), free(), delete, etc
- Dynamically allocated as needed
- Data
- Statically allocated data
- ex) global vars, static vars, string consts
- Statically allocated data
- Text
- Executable machine instructions
- Read-only
- Executable machine instructions
- Shared libraries
- Executable machine instructions
- Read only
Example
Where would each part of the code go?
?
References:
Created:: 2022-02-12 15:55