You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On POSIX, mmap objects could expose a method wrapping the madvise() library call. I suggest the following API
mmap_object.madvise(option[, start[, length]])
If omitted, *start* and *length* would span the whole memory area described by the mmap object. *option* must be a recognized OS option for the madvise() library call.
The mmap module would expose the various MADV_* options available on the current platform.
Open question: should we expose madvise() or posix_madvise()? (these are two different calls, at least on Linux) posix_madvise() is arguably more portable, but madvise() is much more powerful, so I'd lean towards madvise().
I kept meaning to file an issue to suggest this, but kept getting hung up on how to make it as portable as possible and as powerful as possible, and where to implement it.
It could go on mmap, but it's also useful for just about any contiguous buffer-supporting object, so it almost seems like adding an os.madvise (and/or os.prefetch) would make more sense than specifically tying it to the mmap module.