-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-37471: mmap module adding FreeBSD specific flag into the constants #14513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to document the constant in https://docs.python.org/dev/library/mmap.html ?
It seems like other MAP_xxx constants are not documented yet and so should be documented as well.
They are (shortly) in the flags section. Ok for adding the new constant too. |
The minimum doc should be a list of constants, like: https://docs.python.org/dev/library/os.html#os.O_RDONLY |
Fair enough ! ought to be before madvise's I think. |
Doc/library/mmap.rst
Outdated
@@ -81,7 +81,11 @@ To map anonymous memory, -1 should be passed as the fileno along with the length | |||
private copy-on-write mapping, so changes to the contents of the mmap | |||
object will be private to this process, and :const:`MAP_SHARED` creates a | |||
mapping that's shared with all other processes mapping the same areas of | |||
the file. The default value is :const:`MAP_SHARED`. | |||
the file. :const:`MAP_ALIGNED_SUPER` (FreeBSD only) allows to map to | |||
pages of 2MB (x86) or so, it is enabled by default, at boot time, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pages of 2MB (x86) or so, it is enabled by default, at boot time, | |
pages of 2 MiB (x86) or so, it is enabled by default, at boot time, |
Is it x86 (32-bit) or x86-64 (64-bit)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write maybe (x86, x86-64) in this case... But I'm not sure if Python documentation should go too far in the description, since FreeBSD may decide to add support for MAP_ALIGNED_SUPER for other platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It supports more than x86 already in fact but you re right I ll try to find more concise wording
@@ -0,0 +1 @@ | |||
Adding new 'MAP_ALIGNED_SUPER' FreeBSD constant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding new 'MAP_ALIGNED_SUPER' FreeBSD constant. | |
Adding new :data:`mmap.MAP_ALIGNED_SUPER` FreeBSD constant. |
MAP_PRIVATE | ||
MAP_DENYWRITE | ||
MAP_EXECUTABLE | ||
MAP_ALIGNED_SUPER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to document that MAP_ALIGNED_SUPER is new, example:
.. versionadded:: 3.9
Add :data:`MAP_ALIGNED_SUPER` constant.
Doc/library/mmap.rst
Outdated
the file. :const:`MAP_ALIGNED_SUPER` (FreeBSD only) allows to map to | ||
pages of 2MB (x86) or so, it is enabled by default, at boot time, | ||
in most of architectures and exists since 2008. | ||
:ref:`MAP_* constants <mmap-constants>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"MAP_* constants" is not really a sentence. Maybe move it after the default, and write something like:
The default value is :const:`MAP_SHARED`.
See :ref:`MAP_* constants <mmap-constants>`.
Doc/library/mmap.rst
Outdated
@@ -341,3 +359,6 @@ MADV_* Constants | |||
Availability: Systems with the madvise() system call. | |||
|
|||
.. versionadded:: 3.8 | |||
|
|||
.. versionadded:: 3.9 | |||
Add :data:`MAP_ALIGNED_SUPER` constant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this to the your new MAP_* Constants section?
@@ -0,0 +1 @@ | |||
Adding new :data:`mmap.MAP_CONCEAL` OpenBSD constant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try to merge the 2 changelog entries? Put content of the 2nd entry in the first one, remove the second file.
MAP_DENYWRITE | ||
MAP_EXECUTABLE | ||
MAP_ALIGNED_SUPER | ||
MAP_CONCEAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to document that MAP_CONCEAL is new.
Doc/library/mmap.rst
Outdated
the file. The default value is :const:`MAP_SHARED`. | ||
the file. :const:`MAP_ALIGNED_SUPER` (FreeBSD only) to use | ||
super pages feature, enabled by default in most of architectures | ||
and exists since 2008. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this sentence :-/ I suggest:
:const:`MAP_ALIGNED_SUPER` (FreeBSD only) uses super pages feature,
it is enabled by default in most of architectures and exists since 2008.
https://bugs.python.org/issue37471