Skip to content
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

Merged
merged 5 commits into from Oct 20, 2018

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Feb 11, 2018

@@ -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.
Copy link
Member

@berkerpeksag berkerpeksag Feb 12, 2018

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

@@ -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
Copy link
Member

@berkerpeksag berkerpeksag Feb 12, 2018

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.

@bedevere-bot
Copy link

bedevere-bot commented Feb 12, 2018

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@pablogsal
Copy link
Member Author

pablogsal commented Feb 12, 2018

I have made the requested changes; please review again

@bedevere-bot
Copy link

bedevere-bot commented Feb 12, 2018

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
PAGESIZE or ALLOCATIONGRANULARITY.
Copy link
Member

@serhiy-storchaka serhiy-storchaka Mar 27, 2018

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.

@pablogsal
Copy link
Member Author

pablogsal commented Mar 27, 2018

I have made the requested changes; please review again

@bedevere-bot
Copy link

bedevere-bot commented Mar 27, 2018

Thanks for making the requested changes!

@berkerpeksag: please review the changes made to this pull request.

@pablogsal
Copy link
Member Author

pablogsal commented Mar 27, 2018

CC: @serhiy-storchaka

@@ -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`.
Copy link
Member

@serhiy-storchaka serhiy-storchaka Mar 28, 2018

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.

@zhangyangyu
Copy link
Member

zhangyangyu commented Mar 28, 2018

FYI, see my comment in the issue, this seems not a necessity required by POSIX. Not sure it matters.

@pablogsal
Copy link
Member Author

pablogsal commented Mar 28, 2018

@zhangyangyu @serhiy-storchaka Should we close the PR then?

@zhangyangyu
Copy link
Member

zhangyangyu commented Mar 28, 2018

I am not sure since there is already such requirement in the doc, like mmap.mmap. Maybe it's already the practical standard? Adding it seems won't hurt.

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Aug 24, 2018

And please update also the formatting of other mention of ALLOCATIONGRANULARITY.

@vstinner vstinner merged commit 027664a into python:master Oct 20, 2018
@bedevere-bot
Copy link

bedevere-bot commented Oct 20, 2018

@vstinner: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

miss-islington commented Oct 20, 2018

Thanks @pablogsal for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒🤖 I'm not a witch! I'm not a witch!

@bedevere-bot
Copy link

bedevere-bot commented Oct 20, 2018

GH-9989 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 20, 2018
…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>
@vstinner
Copy link
Member

vstinner commented Oct 20, 2018

@vstinner: Please replace # with GH- in the commit message next time. Thanks!

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaah.

@bedevere-bot
Copy link

bedevere-bot commented Oct 20, 2018

GH-9990 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 20, 2018
…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>
@miss-islington
Copy link
Contributor

miss-islington commented Oct 20, 2018

Thanks @pablogsal for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7.
🐍🍒🤖

@bedevere-bot
Copy link

bedevere-bot commented Oct 20, 2018

GH-9991 is a backport of this pull request to the 2.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 20, 2018
…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>
miss-islington added a commit that referenced this pull request Oct 20, 2018
…the docs (GH-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>
miss-islington added a commit that referenced this pull request Oct 20, 2018
…the docs (GH-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>
miss-islington added a commit that referenced this pull request Oct 20, 2018
…the docs (GH-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>
@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Oct 20, 2018

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

yahya-abou-imran pushed a commit to yahya-abou-imran/cpython that referenced this pull request Nov 2, 2018
…the docs (python#5621)

Add restriction on the offset parameter for mmap.flush.

Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix.
@pablogsal pablogsal deleted the bpo32798 branch May 19, 2021
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.

None yet

8 participants