-
Notifications
You must be signed in to change notification settings - Fork 72
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
Added MmapOptions::no_reserve
method
#115
Conversation
I'd also like to add support for windows, but its API is not designed to be completely transparent, need use |
I have zero expertise about VirtualAlloc and winapi in general. But I would suggest calling |
Ok, I guess we need introduce a new |
I think for feature parity, it would suffice to just commit the whole range during creation on Windows, not lazily during access. This will avoid all the abstractions and indirections into during dereferencing. |
Agreed, for most scenarios it's possible to commit all memory at creation time. However, for some special scenarios, such as the need for a huge sparse array or the need to be able to scale the memory size at runtime, it is not possible to predict exactly how much memory will be needed at creation time. |
But since this crate is a portable layer as much as possible, we do not need to support everything the underlying OS do. We can choose a sane common denominator and since we canot avoid increasing the complexity of this crate significantly if we interpret |
That's why my 9326e4e commit just add a It's okay. If you don't like the feature, I can close the PR. |
I did not say that. I dislike the additional complexity introduced by the third commit. Either requiring explicit action by the caller or implicit commit upon creation are fine in my opinion. |
Added
MmapOptions::no_reserve
method to support not to reserve swap space for this mapping. Linux only.