Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy-on-write support #78

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

StrikerX3
Copy link

@StrikerX3 StrikerX3 commented Nov 14, 2021

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 aliases mio::mmap_cow_sink and mio::ummap_cow_sink as well as the shared counterparts, and they can be created with mio::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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant