Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5a8a84b3
Commit
5a8a84b3
authored
Nov 07, 2017
by
Justus Schwabedal
Committed by
Victor Stinner
Nov 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added :const:`mmap.ACCESS_DEFAULT` constant. (#4093)
parent
c62f0cb3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
Doc/library/mmap.rst
Doc/library/mmap.rst
+14
-10
Misc/NEWS.d/next/Library/2017-10-23.bpo-31854.fh8334f.rst
Misc/NEWS.d/next/Library/2017-10-23.bpo-31854.fh8334f.rst
+1
-0
Modules/mmapmodule.c
Modules/mmapmodule.c
+1
-0
No files found.
Doc/library/mmap.rst
View file @
5a8a84b3
...
...
@@ -29,16 +29,20 @@ still needs to be closed when done).
mapping.
For both the Unix and Windows versions of the constructor, *access* may be
specified as an optional keyword parameter. *access* accepts one of three
values: :const:`ACCESS_READ`, :const:`ACCESS_WRITE`, or :const:`ACCESS_COPY`
to specify read-only, write-through or copy-on-write memory respectively.
*access* can be used on both Unix and Windows. If *access* is not specified,
Windows mmap returns a write-through mapping. The initial memory values for
all three access types are taken from the specified file. Assignment to an
:const:`ACCESS_READ` memory map raises a :exc:`TypeError` exception.
Assignment to an :const:`ACCESS_WRITE` memory map affects both memory and the
underlying file. Assignment to an :const:`ACCESS_COPY` memory map affects
memory but does not update the underlying file.
specified as an optional keyword parameter. *access* accepts one of four
values: :const:`ACCESS_READ`, :const:`ACCESS_WRITE`, or :const:`ACCESS_COPY` to
specify read-only, write-through or copy-on-write memory respectively, or
:const:`ACCESS_DEFAULT` to defer to *prot*. *access* can be used on both Unix
and Windows. If *access* is not specified, Windows mmap returns a
write-through mapping. The initial memory values for all three access types
are taken from the specified file. Assignment to an :const:`ACCESS_READ`
memory map raises a :exc:`TypeError` exception. Assignment to an
:const:`ACCESS_WRITE` memory map affects both memory and the underlying file.
Assignment to an :const:`ACCESS_COPY` memory map affects memory but does not
update the underlying file.
.. versionchanged:: 3.7
Added :const:`ACCESS_DEFAULT` constant.
To map anonymous memory, -1 should be passed as the fileno along with the length.
...
...
Misc/NEWS.d/next/Library/2017-10-23.bpo-31854.fh8334f.rst
0 → 100644
View file @
5a8a84b3
Add ``mmap.ACCESS_DEFAULT`` constant.
Modules/mmapmodule.c
View file @
5a8a84b3
...
...
@@ -1466,6 +1466,7 @@ PyInit_mmap(void)
setint
(
dict
,
"ALLOCATIONGRANULARITY"
,
(
long
)
my_getallocationgranularity
());
setint
(
dict
,
"ACCESS_DEFAULT"
,
ACCESS_DEFAULT
);
setint
(
dict
,
"ACCESS_READ"
,
ACCESS_READ
);
setint
(
dict
,
"ACCESS_WRITE"
,
ACCESS_WRITE
);
setint
(
dict
,
"ACCESS_COPY"
,
ACCESS_COPY
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment