Commit 2bad7acd authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by GitHub

bpo-32798: Add restriction on the offset parameter for mmap.flush in 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 027664a3)
Co-authored-by: default avatarPablo Galindo <Pablogsal@gmail.com>
parent b0f7fa1d
...@@ -68,7 +68,7 @@ memory but does not update the underlying file. ...@@ -68,7 +68,7 @@ memory but does not update the underlying file.
*offset* may be specified as a non-negative integer offset. mmap references *offset* may be specified as a non-negative integer offset. mmap references
will be relative to the offset from the beginning of the file. *offset* will be relative to the offset from the beginning of the file. *offset*
defaults to 0. *offset* must be a multiple of the ALLOCATIONGRANULARITY. defaults to 0. *offset* must be a multiple of the :const:`ALLOCATIONGRANULARITY`.
.. class:: mmap(fileno, length[, flags[, prot[, access[, offset]]]]) .. class:: mmap(fileno, length[, flags[, prot[, access[, offset]]]])
...@@ -97,8 +97,8 @@ memory but does not update the underlying file. ...@@ -97,8 +97,8 @@ memory but does not update the underlying file.
*offset* may be specified as a non-negative integer offset. mmap references *offset* may be specified as a non-negative integer offset. mmap references
will be relative to the offset from the beginning of the file. *offset* will be relative to the offset from the beginning of the file. *offset*
defaults to 0. *offset* must be a multiple of the PAGESIZE or defaults to 0. *offset* must be a multiple of :const:`ALLOCATIONGRANULARITY`
ALLOCATIONGRANULARITY. which is equal to :const:`PAGESIZE` on Unix systems.
To ensure validity of the created memory mapping the file specified To ensure validity of the created memory mapping the file specified
by the descriptor *fileno* is internally automatically synchronized by the descriptor *fileno* is internally automatically synchronized
...@@ -171,7 +171,8 @@ memory but does not update the underlying file. ...@@ -171,7 +171,8 @@ memory but does not update the underlying file.
use of this call there is no guarantee that changes are written back before 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 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 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`.
**(Windows version)** A nonzero value returned indicates success; zero **(Windows version)** A nonzero value returned indicates success; zero
indicates failure. indicates failure.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment