Closed baloo closed 1 year ago
Hi,
I had to look at the code again, since the change itself is a bit confusing. The flag got renamed to MmapFlags::SHARED
here (https://github.com/StephanvanSchaik/mmap-rs/blob/master/src/mmap.rs#L21), such that it defaults to what would be MmapFlags::PRIVATE
(but the flag itself is undefined) and you can opt into MmapFlags::SHARED
. I hope that clears that up that particular modification.
Thanks!
oh! https://docs.rs/mmap-rs/0.5.0/mmap_rs/struct.MmapFlags.html#associatedconstant.COPY_ON_WRITE yeah the documentation for copy on write was misleading I think.
I actually used COPY_ON_WRITE
in my code expecting PRIVATE
, but that's not what I was using haha.
Anyway, thanks!
oh! https://docs.rs/mmap-rs/0.5.0/mmap_rs/struct.MmapFlags.html#associatedconstant.COPY_ON_WRITE yeah the documentation for copy on write was misleading I think.
Yes, you are right. That is why I decided to simplify this in mmap-rs 0.6 to private (default) vs. shared, as not every platform may even bother using copy-on-write, and there are usually no flags to choose between private vs. copy-on-write (i.e. a shared mapping that becomes private once written), and to most users that distinction shouldn't matter, as they are both seemingly private.
As a result the documentation for older versions is unfortunately misleading, but hopefully this clears up the situation a bit better.
I believe there was a mistake in the changelog when it got redacted and there a mix up between
MmapFlags::PRIVATE
andMmapFlags::SHARED
.I'm not 100% confident, sending the PR to raise the question! (feel free to just close)