3 ms·
Just in case anyone still doesn't understand what that means to be statically allocated. It means that they are allocated in the Data Segment, which is a separa
by tcoff91 2y ago
Just in case anyone still doesn't understand what that means to be statically allocated. It means that they are allocated in the Data Segment, which is a separate area of virtual memory from the stack and the heap.
- levodelellis 2y agoOnly if it's const. Otherwise the data is copied into memory you can write to
- tcoff91 2y agoIsn’t there a part of the data segment that is writable? Initialized vs uninitialized data segment right?
- levodelellis 2y agoYou're right, I know mutable and read-only are separates, I know I seen gcc and clang put static int and global int in the same page, and I know I heard people say global variables are on the heap thousands of times. I guess I forgot global writable data doesn't necessarily mean heap nor the read-only section of memory