-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs #5621
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
Doc/library/mmap.rst
Outdated
| changes to the given range of bytes will be flushed to disk; otherwise, the | ||
| whole extent of the mapping is flushed. | ||
| whole extent of the mapping is flushed. *offset* must be a multiple of the | ||
| PAGESIZE. |
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.
Since this is the platform independent documentation, I think it should say "PAGESIZE or ALLOCATIONGRANULARITY".
Doc/library/mmap.rst
Outdated
| the object is destroyed. If *offset* and *size* are specified, only | ||
| changes to the given range of bytes will be flushed to disk; otherwise, the | ||
| whole extent of the mapping is flushed. | ||
| whole extent of the mapping is flushed. *offset* must be a multiple of the |
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.
Style nit: Please follow the present style and start the sentence with two spaces.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @berkerpeksag: please review the changes made to this pull request. |
Doc/library/mmap.rst
Outdated
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.
Please format these constants as
:const:`PAGESIZE` and :const:`ALLOCATIONGRANULARITY`And in the constructor too.
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @berkerpeksag: please review the changes made to this pull request. |
Doc/library/mmap.rst
Outdated
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.
Please update also the formatting of other mention of these constants.
|
FYI, see my comment in the issue, this seems not a necessity required by POSIX. Not sure it matters. |
|
@zhangyangyu @serhiy-storchaka Should we close the PR then? |
|
I am not sure since there is already such requirement in the doc, like |
Doc/library/mmap.rst
Outdated
| defaults to 0. *offset* must be a multiple of the PAGESIZE or | ||
| ALLOCATIONGRANULARITY. | ||
| defaults to 0. *offset* must be a multiple of the :const:`PAGESIZE` or | ||
| :const:`ALLOCATIONGRANULARITY`. |
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.
ALLOCATIONGRANULARITY is equivalent of PAGESIZE under Unix. Since this documentation for the Unix version of mmap.mmap(), perhapd we can remove ALLOCATIONGRANULARITY from the documentation?
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.
Nit: "a multiple of the"
Can "the" be removed here?
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.
Done in 2d90d92
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 think it is better to use the same condition on all platforms. Since ALLOCATIONGRANULARITY is equivalent of PAGESIZE under Unix, you can use ALLOCATIONGRANULARITY as well as PAGESIZE.
Maybe change the wording to something like: "offset must be a multiple of ALLOCATIONGRANULARITY which is equal to PAGESIZE under Unix"?
|
And please update also the formatting of other mention of |
|
@vstinner: Please replace |
|
Thanks @pablogsal for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
|
GH-9989 is a backport of this pull request to the 3.7 branch. |
…the docs (pythonGH-5621) Add restriction on the offset parameter for mmap.flush. Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix. (cherry picked from commit 027664a) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaah. |
|
GH-9990 is a backport of this pull request to the 3.6 branch. |
…the docs (pythonGH-5621) Add restriction on the offset parameter for mmap.flush. Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix. (cherry picked from commit 027664a) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
Thanks @pablogsal for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7. |
|
GH-9991 is a backport of this pull request to the 2.7 branch. |
…the docs (pythonGH-5621) Add restriction on the offset parameter for mmap.flush. Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix. (cherry picked from commit 027664a) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
I left this issue open because its author is a core developer now, and is able to merge his PRs yourself (after making last moment changes if needed). |
https://bugs.python.org/issue32798