summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorDavid CARLIER <devnexen@gmail.com>2020-11-21 11:39:56 (GMT)
committerGitHub <noreply@github.com>2020-11-21 11:39:56 (GMT)
commit0e62efc51e31c741b61604787aeab4936e6e50e4 (patch)
tree6225f28f1bceae5d51cbf602cf2e3cba9157d2de /Modules
parent1db76394ea79030aa4ed5349c950f6c6da51450f (diff)
downloadcpython-0e62efc51e31c741b61604787aeab4936e6e50e4.zip
cpython-0e62efc51e31c741b61604787aeab4936e6e50e4.tar.gz
cpython-0e62efc51e31c741b61604787aeab4936e6e50e4.tar.bz2
bpo-42232: mmap module add Darwin specific madvise options. (GH-23076)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/mmapmodule.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 1e96849..1e66962 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -1667,6 +1667,14 @@ mmap_exec(PyObject *module)
#ifdef MADV_PROTECT
ADD_INT_MACRO(module, MADV_PROTECT);
#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
return 0;
}