bpo-42232: mmap module add Darwin specific madvise options. (GH-23076)
This commit is contained in:
parent
1db76394ea
commit
0e62efc51e
|
@ -337,6 +337,8 @@ MADV_* Constants
|
||||||
MADV_NOCORE
|
MADV_NOCORE
|
||||||
MADV_CORE
|
MADV_CORE
|
||||||
MADV_PROTECT
|
MADV_PROTECT
|
||||||
|
MADV_FREE_REUSABLE
|
||||||
|
MADV_FREE_REUSE
|
||||||
|
|
||||||
These options can be passed to :meth:`mmap.madvise`. Not every option will
|
These options can be passed to :meth:`mmap.madvise`. Not every option will
|
||||||
be present on every system.
|
be present on every system.
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Added Darwin specific madvise options to mmap module.
|
|
@ -1667,6 +1667,14 @@ mmap_exec(PyObject *module)
|
||||||
#ifdef MADV_PROTECT
|
#ifdef MADV_PROTECT
|
||||||
ADD_INT_MACRO(module, MADV_PROTECT);
|
ADD_INT_MACRO(module, MADV_PROTECT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Darwin-specific
|
||||||
|
#ifdef MADV_FREE_REUSABLE // (As MADV_FREE but reclaims more faithful for task_info/Activity Monitor...)
|
||||||
|
ADD_INT_MACRO(module, MADV_FREE_REUSABLE);
|
||||||
|
#endif
|
||||||
|
#ifdef MADV_FREE_REUSE // (Reuse pages previously tagged as reusable)
|
||||||
|
ADD_INT_MACRO(module, MADV_FREE_REUSE);
|
||||||
|
#endif
|
||||||
#endif // HAVE_MADVISE
|
#endif // HAVE_MADVISE
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue