Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes add a new access mode that performs copy-on-write, allowing changes to be made to the data in memory without them being committed to the file system. The new access mode is exposed through the new
mio::basic_mmap_cow_sink
and its convenience aliasesmio::mmap_cow_sink
andmio::ummap_cow_sink
as well as the shared counterparts, and they can be created withmio::make_mmap_cow_sink(...)
just like regular sinks. This implements the feature requested in #42.One use case is for emulators to load and modify ROM files in memory to decrypt data or apply patches without touching the original ROM file while also benefitting from the memory-mapped file characteristics.
I've confirmed these changes work on Windows 10 and Ubuntu 20.04. I don't have a macOS system, though.
This also fixes the
s_2_ws
linking issue mentioned in #75 and missing<vector>
header on MSVC (#76).