Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jul 1, 2019

@ghost ghost changed the title mmap module adding FreeBSD specific flag into the constants 37471: mmap module adding FreeBSD specific flag into the constants Jul 1, 2019
@ghost ghost changed the title 37471: mmap module adding FreeBSD specific flag into the constants bpo-37471: mmap module adding FreeBSD specific flag into the constants Jul 1, 2019
Copy link
Member

@vstinner vstinner left a 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.

@ghost
Copy link
Author

ghost commented Jul 1, 2019

They are (shortly) in the flags section. Ok for adding the new constant too.

@vstinner
Copy link
Member

vstinner commented Jul 1, 2019

The minimum doc should be a list of constants, like: https://docs.python.org/dev/library/os.html#os.O_RDONLY

@ghost
Copy link
Author

ghost commented Jul 1, 2019

Fair enough ! ought to be before madvise's I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both.

Copy link
Member

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.

Copy link
Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Adding new 'MAP_ALIGNED_SUPER' FreeBSD constant.
Adding new :data:`mmap.MAP_ALIGNED_SUPER` FreeBSD constant.

Copy link
Member

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.

Copy link
Member

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>`.

Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants