Skip to content

Conversation

@pablogsal
Copy link
Member

@pablogsal pablogsal commented Feb 11, 2018

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

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

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

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

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

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

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

Copy link
Member

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

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

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

@pablogsal
Copy link
Member Author

CC: @serhiy-storchaka

Copy link
Member

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

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

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.

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

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?

Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 2d90d92

Copy link
Member

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

@serhiy-storchaka
Copy link
Member

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

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

@miss-islington
Copy link
Contributor

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

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: Please replace # with GH- in the commit message next time. Thanks!

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaah.

@bedevere-bot
Copy link

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

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

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

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

@pablogsal pablogsal deleted the bpo32798 branch May 19, 2021 18:57
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.

8 participants