3 ms·
I'll add that by segregating read-only and writeable data, you allow the virtual memory system to efficiently share a single copy of the read-only data among al
by twoodfin 11y ago
I'll add that by segregating read-only and writeable data, you allow the virtual memory system to efficiently share a single copy of the read-only data among all processes loading it.
- cnvogel 11y agoYou are perfectly right. And there's also a second use-case: In some embedded applications things run directly from ROM/flash and things put in the .rodata-section will stay there and not get copied to RAM (which you obviously have to do for modifyable data).