This changes the memory-mapping system to detect when a file is not writable, and map it read-only instead of read-write.
I've turned off setting the direct-jump flags in the pointers and trying to trim the file on close, in those cases, but the read-only-ness isn't enforced with const-ness of the UniqueMappedPointer and will show up as a segfault if you load from a read-only file and then try to write.
This changes the memory-mapping system to detect when a file is not writable, and map it read-only instead of read-write.
I've turned off setting the direct-jump flags in the pointers and trying to trim the file on close, in those cases, but the read-only-ness isn't enforced with const-ness of the UniqueMappedPointer and will show up as a segfault if you load from a read-only file and then try to write.