summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-0/+10
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-36648: fix mmap issue for VxWorks (GH-12394)Lihua Zhao2019-05-211-0/+7
| | | | | The mmap module set MAP_SHARED flag when map anonymous memory, however VxWorks only support MAP_PRIVATE when map anonymous memory, this commit clear MAP_SHARED and set MAP_PRIVATE.
* bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)Zackery Spytz2019-05-171-2/+4
| | | | | | | The final addition (cur += step) may overflow, so use size_t for "cur". "cur" is always positive (even for negative steps), so it is safe to use size_t here. Co-Authored-By: Martin Panter <vadmium+py@gmail.com>
* bpo-36139: Fix mmap_object_dealloc(): hold the GIL to call PyMem_Free() ↵Davide Rizzo2019-03-061-2/+4
| | | | (GH-12199)
* closes bpo-36139: release GIL around munmap(). (GH-12073)Davide Rizzo2019-03-061-14/+25
|
* bpo-33029: Fix signatures of getter and setter functions. (GH-10746)Serhiy Storchaka2018-11-271-1/+1
| | | Fix also return type for few other functions (clear, releasebuffer).
* Fix misleading mentions of tp_size in comments (GH-9093)Peter Eisentraut2018-09-101-1/+1
| | | | Many type object initializations labeled a field "tp_size" in the comment, but the name of that field is tp_basicsize.
* bpo-2122: Make mmap.flush() behave same on all platforms (GH-8692)Berker Peksag2018-08-221-4/+7
| | | | | Previously, its behavior was platform-dependent and there was no error checking under Windows.
* bpo-33767: Fix improper use of SystemError by mmap.mmap objects (GH-7381)Zackery Spytz2018-06-051-20/+2
| | | | Raise TypeError instead of SystemError for unsupported operations.
* Fix typos in mmap() error messages (GH-6173)Zackery Spytz2018-03-211-2/+2
|
* bpo-33021: Fix GCC 7 warning (-Wmaybe-uninitialized) in mmapmodule.c (#6117)Zackery Spytz2018-03-141-1/+1
|
* bpo-33021: Release the GIL during fstat() calls (GH-6019)Nir Soffer2018-03-111-2/+9
| | | | | | | | | | | | | | fstat may block for long time if the file descriptor is on a non-responsive NFS server, hanging all threads. Most fstat() calls are handled by _Py_fstat(), releasing the GIL internally, but but _Py_fstat_noraise() does not release the GIL, and most calls release the GIL explicitly around it. This patch fixes last 2 calls to _Py_fstat_no_raise(), avoiding hangs when calling: - mmap.mmap() - os.urandom() - random.seed()
* Add the const qualifier to "char *" variables that refer to literal strings. ↵Serhiy Storchaka2017-11-111-1/+1
| | | | (#4370)
* Added :const:`mmap.ACCESS_DEFAULT` constant. (#4093)Justus Schwabedal2017-11-071-0/+1
|
* Expand the PySlice_GetIndicesEx macro. (#1023)Serhiy Storchaka2017-04-081-5/+4
|
* bpo-29852: Argument Clinic Py_ssize_t converter now supports None (#716)Serhiy Storchaka2017-03-301-24/+1
| | | if pass `accept={int, NoneType}`.
* bpo-29730: replace some calls to PyNumber_Check and improve some error ↵Oren Milman2017-03-121-3/+4
| | | | messages (#650)
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-12/+6
| | | | possible. Patch is writen with Coccinelle.
* merge 3.5Benjamin Peterson2016-10-061-1/+1
|\
| * ensure read size is initializedBenjamin Peterson2016-10-061-1/+1
| |
* | merge 3.5Benjamin Peterson2016-10-061-1/+3
|\ \ | |/
| * do not leak buffer if mmap is not writableBenjamin Peterson2016-10-061-1/+3
| |
* | merge 3.5Benjamin Peterson2016-10-061-112/+79
|\ \ | |/
| * mmap: do all internal arithmetic with Py_ssize_t while being very careful ↵Benjamin Peterson2016-10-061-109/+78
| | | | | | | | about overflow
* | Issue #23524: Finish removing _PyVerify_fd from sourcesSteve Dower2016-09-081-4/+0
| |
* | replace PY_LONG_LONG with long longBenjamin Peterson2016-09-061-6/+6
| |
* | Issue #26335: Make mmap.write() return the number of bytes written likeBerker Peksag2016-03-021-2/+3
|/ | | | | | other write methods. Patch by Jakub Stasiak.
* Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka2015-12-191-1/+1
| | | | | This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
* Merge 3.4 (#24217)Benjamin Peterson2015-08-021-2/+2
|\
| * include fcntl.h on all *nix platforms (closes #24217)Benjamin Peterson2015-08-021-2/+2
| | | | | | | | Patch by Jeffrey Armstrong.
* | Issue #23524: Replace _PyVerify_fd function with calls to ↵Steve Dower2015-04-121-1/+3
| | | | | | | | _set_thread_local_invalid_parameter_handler.
* | Issue #23752: _Py_fstat() is now responsible to raise the Python exceptionVictor Stinner2015-03-301-13/+12
| | | | | | | | Add _Py_fstat_noraise() function when a Python exception is not welcome.
* | Issue #23753: Python doesn't support anymore platforms without stat() orVictor Stinner2015-03-241-4/+0
| | | | | | | | | | | | | | fstat(), these functions are always required. Remove HAVE_STAT and HAVE_FSTAT defines, and stop supporting DONT_HAVE_STAT and DONT_HAVE_FSTAT.
* | Issue #23001: Few functions in modules mmap, ossaudiodev, socket, ssl, andSerhiy Storchaka2015-03-201-11/+17
| | | | | | | | | | codecs, that accepted only read-only bytes-like object now accept writable bytes-like object too.
* | Fix compiler warning in mmapmodule.c (compare signed/unsigned integers)Victor Stinner2015-03-181-1/+1
| |
* | Issue #23694: Enhance _Py_open(), it now raises exceptionsVictor Stinner2015-03-171-1/+0
| | | | | | | | | | | | | | | | * _Py_open() now raises exceptions on error. If open() fails, it raises an OSError with the filename. * _Py_open() now releases the GIL while calling open() * Add _Py_open_noraise() when _Py_open() cannot be used because the GIL is not held
* | Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on ↵Steve Dower2015-02-211-4/+4
|/ | | | | | Windows. fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
* Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows.Serhiy Storchaka2014-08-191-0/+16
|
* Issue #16136: Remove VMS support and VMS-related codeChristian Heimes2013-12-211-6/+0
|
* Issue #18571: Implementation of the PEP 446: file descriptors and file handlesVictor Stinner2013-08-271-4/+4
| | | | | are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
* Issue #4885: Add weakref support to mmap objects. Patch by Valerie Lambert.Antoine Pitrou2013-08-051-1/+7
|
* MergeRichard Oudkerk2013-02-131-11/+11
|\
| * Issue #16743: Fix mmap overflow check on 32 bit WindowsRichard Oudkerk2013-02-131-11/+11
| |
* | MERGE: #15676: mmap: add empty file check prior to offset check <- Previous ↵Jesus Cea2012-09-101-0/+1
|\ \ | |/ | | | | patch was incomplete (fix 2)
| * #15676: mmap: add empty file check prior to offset check <- Previous patch ↵Jesus Cea2012-09-101-0/+1
| | | | | | | | was incomplete (fix 2)
* | #15676: mmap: add empty file check prior to offset check <- Previous patch ↵Jesus Cea2012-09-101-0/+5
|\ \ | |/ | | | | was incomplete
| * #15676: mmap: add empty file check prior to offset check <- Previous patch ↵Jesus Cea2012-09-101-0/+5
| | | | | | | | was incomplete
* | Closes #15676: mmap: add empty file check prior to offset checkJesus Cea2012-09-091-0/+5
|\ \ | |/
| * Closes #15676: mmap: add empty file check prior to offset checkJesus Cea2012-09-091-0/+5
| |
* | Whitespace.Stefan Krah2012-03-061-14/+14
| |