Skip to content

Commit 347f740

Browse files
authored
gh-81652: Add MAP_ALIGNED_SUPER FreeBSD and MAP_CONCEAL OpenBSD constants (gh-102191)
1 parent 9f3ecd1 commit 347f740

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

Doc/library/mmap.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,19 @@ MAP_* Constants
370370
MAP_ANONYMOUS
371371
MAP_POPULATE
372372
MAP_STACK
373+
MAP_ALIGNED_SUPER
374+
MAP_CONCEAL
373375

374-
These are the various flags that can be passed to :meth:`mmap.mmap`. Note that some options might not be present on some systems.
376+
These are the various flags that can be passed to :meth:`mmap.mmap`. :data:`MAP_ALIGNED_SUPER`
377+
is only available at FreeBSD and :data:`MAP_CONCEAL` is only available at OpenBSD. Note
378+
that some options might not be present on some systems.
375379

376380
.. versionchanged:: 3.10
377-
Added MAP_POPULATE constant.
381+
Added :data:`MAP_POPULATE` constant.
378382

379383
.. versionadded:: 3.11
380-
Added MAP_STACK constant.
384+
Added :data:`MAP_STACK` constant.
385+
386+
.. versionadded:: 3.12
387+
Added :data:`MAP_ALIGNED_SUPER` constant.
388+
Added :data:`MAP_CONCEAL` constant.

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,7 @@ Derek D. Kim
930930
Gihwan Kim
931931
Jan Kim
932932
Taek Joo Kim
933+
Yeojin Kim
933934
Sam Kimbrel
934935
Tomohiko Kinebuchi
935936
James King
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add :data:`mmap.MAP_ALIGNED_SUPER` FreeBSD and :data:`mmap.MAP_CONCEAL`
2+
OpenBSD constants to :mod:`mmap`. Patch by Yeojin Kim.

Modules/mmapmodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,12 @@ mmap_exec(PyObject *module)
16031603
// Mostly a no-op on Linux and NetBSD, but useful on OpenBSD
16041604
// for stack usage (even on x86 arch)
16051605
ADD_INT_MACRO(module, MAP_STACK);
1606+
#endif
1607+
#ifdef MAP_ALIGNED_SUPER
1608+
ADD_INT_MACRO(module, MAP_ALIGNED_SUPER);
1609+
#endif
1610+
#ifdef MAP_CONCEAL
1611+
ADD_INT_MACRO(module, MAP_CONCEAL);
16061612
#endif
16071613
if (PyModule_AddIntConstant(module, "PAGESIZE", (long)my_getpagesize()) < 0 ) {
16081614
return -1;

0 commit comments

Comments
 (0)