memmap-rs
                                
                                 memmap-rs copied to clipboard
                                
                                    memmap-rs copied to clipboard
                            
                            
                            
                        Support madvise.
It might be useful to add support for POSIX madvise, and/or something like CreateFile with FILE_FLAG_SEQUENTIAL_SCAN on Windows.
Is this something within the scope of this crate? Or is this be something to be left to another crate?
On Windows, you can also do something similar to POSIX's WILLNEED using the PrefetchVirtualMemory syscall.
In some other cases the passive or infrequently-engaging maintainer(s) of this crate have suggested publishing new functionality elsewhere, in other crates.  I've included support for a subset of libc::posix_madvise in the olio crate via olio::mem::MemHandle in a concurrent-access aware fashion.  See unit tests in the source for examples wrapping an Mmap.   Benchmarks show performance win of Sequential advice proceeding sequential access.
While this is currently limited to *nix, I would welcome a patch for Sequential advice on Windows. See https://github.com/dekellum/olio
Right, my take in the past has been that madvise should probably be provided by a separate crate.  The non-cross-platform aspects of it make it a tough API to wrap.
That being said if someone can make the case that madvise is only useful in combination with memory-mapped memory then I'm open to including it in memmap.
madvise could be implemented as a no-op on all platforms where it isn't supported.