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

Support Mmap*::lock on Windows #127

Open
DrChat opened this issue Dec 5, 2024 · 1 comment
Open

Support Mmap*::lock on Windows #127

DrChat opened this issue Dec 5, 2024 · 1 comment

Comments

@DrChat
Copy link

DrChat commented Dec 5, 2024

Windows supports locking virtual memory into physical memory via the VirtualLock function (and conversely VirtualUnlock).

One crucial difference from Unix is that you must first ensure that the process working set size is large enough to accommodate the memory region via SetProcessWorkingSetSize.
The easiest solution here would be to just leave it up to callers to configure the working set size (and giving them a reminder to do so in the documentation).

@de-vri-es
Copy link
Collaborator

de-vri-es commented Dec 5, 2024

The limit is pretty similar to the RLIMIT_MEMLOCK on Linux. POSIX itself only mentions a "implementation defined limit". So it seems that the behaviour of VirtualLock() is pretty much compatible with mlock() \o/

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

No branches or pull requests

2 participants