mirror of https://github.com/python/cpython
bpo-46176: mmap module adding MAP_STACK constant. (GH-30252)
This commit is contained in:
parent
77195cd44b
commit
66c47b63a0
|
@ -367,8 +367,12 @@ MAP_* Constants
|
|||
MAP_ANON
|
||||
MAP_ANONYMOUS
|
||||
MAP_POPULATE
|
||||
MAP_STACK
|
||||
|
||||
These are the various flags that can be passed to :meth:`mmap.mmap`. Note that some options might not be present on some systems.
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
Added MAP_POPULATE constant.
|
||||
|
||||
.. versionadded:: 3.11
|
||||
Added MAP_STACK constant.
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Adding the ``MAP_STACK`` constant for the mmap module.
|
|
@ -1637,6 +1637,11 @@ mmap_exec(PyObject *module)
|
|||
#endif
|
||||
#ifdef MAP_POPULATE
|
||||
ADD_INT_MACRO(module, MAP_POPULATE);
|
||||
#endif
|
||||
#ifdef MAP_STACK
|
||||
// Mostly a no-op on Linux and NetBSD, but useful on OpenBSD
|
||||
// for stack usage (even on x86 arch)
|
||||
ADD_INT_MACRO(module, MAP_STACK);
|
||||
#endif
|
||||
if (PyModule_AddIntConstant(module, "PAGESIZE", (long)my_getpagesize()) < 0 ) {
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue