Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75ee130

Browse files
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 027664a) Co-authored-by: Pablo Galindo <[email protected]>
1 parent efc09a9 commit 75ee130

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Doc/library/mmap.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
6161

6262
*offset* may be specified as a non-negative integer offset. mmap references
6363
will be relative to the offset from the beginning of the file. *offset*
64-
defaults to 0. *offset* must be a multiple of the ALLOCATIONGRANULARITY.
64+
defaults to 0. *offset* must be a multiple of the :const:`ALLOCATIONGRANULARITY`.
6565

6666

6767
.. class:: mmap(fileno, length, flags=MAP_SHARED, prot=PROT_WRITE|PROT_READ, access=ACCESS_DEFAULT[, offset])
@@ -90,8 +90,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
9090

9191
*offset* may be specified as a non-negative integer offset. mmap references
9292
will be relative to the offset from the beginning of the file. *offset*
93-
defaults to 0. *offset* must be a multiple of the PAGESIZE or
94-
ALLOCATIONGRANULARITY.
93+
defaults to 0. *offset* must be a multiple of :const:`ALLOCATIONGRANULARITY`
94+
which is equal to :const:`PAGESIZE` on Unix systems.
9595

9696
To ensure validity of the created memory mapping the file specified
9797
by the descriptor *fileno* is internally automatically synchronized
@@ -185,7 +185,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
185185
use of this call there is no guarantee that changes are written back before
186186
the object is destroyed. If *offset* and *size* are specified, only
187187
changes to the given range of bytes will be flushed to disk; otherwise, the
188-
whole extent of the mapping is flushed.
188+
whole extent of the mapping is flushed. *offset* must be a multiple of the
189+
:const:`PAGESIZE` or :const:`ALLOCATIONGRANULARITY`.
189190

190191
**(Windows version)** A nonzero value returned indicates success; zero
191192
indicates failure.

0 commit comments

Comments
 (0)