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
bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs #5621
Conversation
Doc/library/mmap.rst
Outdated
| @@ -189,7 +189,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length | |||
| use of this call there is no guarantee that changes are written back before | |||
| 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 | |||
| 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
| @@ -189,7 +189,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length | |||
| use of this call there is no guarantee that changes are written back before | |||
| 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
| @@ -189,7 +189,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length | |||
| use of this call there is no guarantee that changes are written back before | |||
| 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 | |||
| PAGESIZE or 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.
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. |
| @@ -189,7 +189,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length | |||
| use of this call there is no guarantee that changes are written back before | |||
| 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 | |||
| :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.
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 |
|
And please update also the formatting of other mention of |
|
@vstinner: Please replace |
|
Thanks @pablogsal for the PR, and @vstinner for merging it |
|
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 |
|
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). |
…the docs (python#5621) Add restriction on the offset parameter for mmap.flush. Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix.
https://bugs.python.org/issue32798