forked from danburkert/memmap-rs
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR implements all remaining madvise values specified in the [Linux man page](https://man7.org/linux/man-pages/man2/madvise.2.html). The following values are added: 1. SOFT_OFFLINE 2. WIPEONFORK 3. KEEPONFORK 4. COLD 5. PAGEOUT 6. COLLAPSE Values 1-5 were mentioned in a comment for future expansion. COLLAPSE was also found to be missing. All six values are memory safe. Brief explanations are below: 1. SOFT_OFFLINE: effects do not change the semantics of the calling process. 2. WIPEONFORK: only affects child processes by zeroing memory post-fork. 3. KEEPONFORK: only affects child processes by preserving memory across fork. 4. COLD: indicates pages are unlikely to be accessed soon; non-destructive. 5. PAGEOUT: requests page reclamation; non-destructive. 6. COLLAPSE: consolidates pages into THPs; non-destructive. I encourage reviewers to verify my safety assumptions.
- Loading branch information
Showing
1 changed file
with
118 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters