-
Notifications
You must be signed in to change notification settings - Fork 120
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
mmap with mmap::protection::MODIFY throws exception #92
Comments
Note that using The only modifications that are possible are changing scalar values in-place. Allocations will allocate from the heap and will lead to dangling pointers in the data serialized in the file.
Yes: read data from disk, modify it in-memory and write it back to another file. Then replace the original file (swap new vs old). |
I added support for MODIFY on windows. However, this should not be used for changing serialized data beyond simple scalar modifications. |
Thanks a lot, I think it's better to cover this issue in the documentation. |
I try to run this simple code and I get exception
'std::runtime_error': what(): open file mode not supported
from file "cista/targets/file.h" line 31
verify(read || write, "open file mode not supported");
I use Windows with msys2(mingw64).
And question. I need load data from disk and modify it, but I don't need to sync data always with disk.
Should I serialize data from disk, copy it to memory and, after changing it, serialize it back?
Or should I just use mmap::modify? I do not fully understand how much mmap costs and what is more efficient"
The text was updated successfully, but these errors were encountered: