Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Only if it's const. Otherwise the data is copied into memory you can write to


Isn’t there a part of the data segment that is writable? Initialized vs uninitialized data segment right?


You'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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: