summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Checking in the code for PEP 357.Guido van Rossum2006-03-071-17/+8
| | | | | | This was mostly written by Travis Oliphant. I've inspected it all; Neal Norwitz and MvL have also looked at it (in an earlier incarnation).
* More unconsting.Martin v. Löwis2006-02-271-2/+2
|
* Fix typo.Martin v. Löwis2006-02-181-1/+1
|
* Fix size computation on Win64.Martin v. Löwis2006-02-181-12/+46
|
* Fix typo.Thomas Wouters2006-02-171-1/+1
|
* Remove size restrictions.Martin v. Löwis2006-02-171-29/+19
|
* mmap_flush_method(): Squash compiler warning aboutTim Peters2006-02-171-2/+2
| | | | mixing signed and unsigned types in comparison.
* Remove space between function name and left parenTim Peters2006-02-171-94/+92
| | | | in function calls.
* Removed pointless parens around `return` expressions;Tim Peters2006-02-161-22/+20
| | | | deleted some curlies around one-line blocks.
* Trimmed trailing whitespace.Tim Peters2006-02-161-41/+41
|
* new_mmap_object(), Windows flavor.Tim Peters2006-02-161-2/+16
| | | | | | | | | | | | | | On a box where sizeof(size_t) == 4, C doesn't define what happens when a size_t value is shifted right by 32 bits, and this caused test_mmap to fail on Windows in a debug build. So use different code to break the size apart depending on how large size_t actually is. This looks like an illusion, since lots of code in this module still appears to assume sizes can't be more than 32 bits (e.g., the internal _GetMapSize() still returns an int), but at least test_mmap passes again.
* More Py_ssize_t format characters.Thomas Wouters2006-02-161-1/+1
|
* Use Py_ssize_t for counts and sizes.Martin v. Löwis2006-02-161-8/+8
|
* Update comment and make accurate.Neal Norwitz2006-02-161-1/+1
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-24/+24
|
* Patch #1407135, bug #1424041, make mmap.mmap(-1, length) work the sameNeal Norwitz2006-02-051-10/+49
| | | | | | | | | | | on both Unix (SVR4 and BSD) and Windows. Restores behaviour of passing -1 for anonymous memory on Unix. Use MAP_ANONYMOUS instead of _ANON since the latter is deprecated according to Linux (gentoo) man pages. Should we continue to allow mmap.mmap(0, length) to work on Windows? 0 is a valid fd. Will backport bugfix portions.
* Whitespace normalizationNeal Norwitz2006-02-051-2/+2
|
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* Fix SF bug #1402308, segfault when using mmap(-1, ...)Neal Norwitz2006-01-111-0/+1
| | | | | | | This didn't crash on Linux, but valgrind complained. I'm not sure if this test is valid on Windows. Will backport.
* SF Patch #1365916, mmap fails on AMD64Neal Norwitz2005-12-181-12/+12
| | | | Fix some 64-bit issues due to mismatch format characters w/actual data types
* Add const to several API functions that take char *.Jeremy Hylton2005-12-101-7/+8
| | | | | | | | | | | | | | | | | | | In C++, it's an error to pass a string literal to a char* function without a const_cast(). Rather than require every C++ extension module to put a cast around string literals, fix the API to state the const-ness. I focused on parts of the API where people usually pass literals: PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type slots, etc. Predictably, there were a large set of functions that needed to be fixed as a result of these changes. The most pervasive change was to make the keyword args list passed to PyArg_ParseTupleAndKewords() to be a const char *kwlist[]. One cast was required as a result of the changes: A type object mallocs the memory for its tp_doc slot and later frees it. PyTypeObject says that tp_doc is const char *; but if the type was created by type_new(), we know it is safe to cast to char *.
* Cleanup the previous checkin.Neal Norwitz2005-11-021-1/+4
| | | | | Close the fd in the close method and invalidated it. Don't try to close a second time when deallocating.
* Bug #1344508, Fix UNIX mmap leaking file descriptors. Will backport.Neal Norwitz2005-11-021-0/+1
|
* C89 compliance.Armin Rigo2005-09-201-2/+2
|
* bug [ 728515 ] mmap's resize method resizes the file in win32 but not unixGeorg Brandl2005-08-241-1/+11
|
* Patches #749830, #1144555: allow UNIX mmap size to default to currentMartin v. Löwis2005-03-031-5/+8
| | | | file size.
* Set data pointer to NULL after an error; this keeps the mmap_dealloc() ↵Andrew M. Kuchling2004-05-191-0/+1
| | | | | | function from trying to do msync(-1);munmap(-1). 2.3 bugfix candidate, but this bug isn't critical enough that the fix has to go into 2.3.4
* Remove support for SunOS 4.Skip Montanaro2004-01-171-5/+0
| | | | Remove BAD_EXEC_PROTOYPE (leftover from IRIX 4 demolition).
* [Patch #708374] Only apply the check for file size if the file is a regular ↵Andrew M. Kuchling2003-07-151-1/+2
| | | | file, not a character or block device.
* Patch #708495: Port more stuff to OpenVMS.Martin v. Löwis2003-05-031-0/+4
|
* Fix two crashes on Windows:Guido van Rossum2003-04-091-2/+2
| | | | | - CHECK_VALID() was checking the wrong value for a closed fd - fseek(&_iob[fileno], ...) doesn't work for fileno >= 20
* SF patch #682514, mmapmodule.c write fix for LP64 executablesNeal Norwitz2003-02-071-1/+1
| | | | | | | Make length an int so we get the right value from PyArg_ParseTuple(args, "s#", &str, &length) Will backport.
* SF #665913, Fix mmap module core dump with unixNeal Norwitz2003-01-101-2/+4
| | | | | | Closing an mmap'ed file (calling munmap) twice on Solaris caused a core dump. Will backport.
* SF bug # 585792, Invalid mmap crashes Python interpreterNeal Norwitz2002-09-051-1/+11
| | | | | Raise ValueError if user passes a size to mmap which is larger than the file.
* Replace DL_IMPORT with PyMODINIT_FUNC and remove "/export:init..." linkMark Hammond2002-07-231-1/+1
| | | | | command line for Windows builds. This should allow MSVC to import and build the Python MSVC6 project files without error.
* Patch #569753: Remove support for WIN16.Martin v. Löwis2002-06-301-17/+17
| | | | Rename all occurrences of MS_WIN32 to MS_WINDOWS.
* SF bug 515943: searching for data with \0 in mmap.Tim Peters2002-03-081-9/+5
| | | | | | | | | mmap_find_method(): this obtained the string to find via s#, but it ignored its length, acting as if it were \0-terminated instead. Someone please run on Linux too (the extended test_mmap works on Windows). Bugfix candidate.
* Patch #477750: Use METH_ constants in Modules.Martin v. Löwis2002-01-171-13/+13
|
* Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis2002-01-121-1/+0
|
* Patch supplied by Burton Radons for his own SF bug #487390: ModifyingGuido van Rossum2001-12-081-1/+1
| | | | | | | | | | | | | type.__module__ behavior. This adds the module name and a dot in front of the type name in every type object initializer, except for built-in types (and those that already had this). Note that it touches lots of Mac modules -- I have no way to test these but the changes look right. Apologies if they're not. This also touches the weakref docs, which contains a sample type object initializer. It also touches the mmap test output, because the mmap type's repr is included in that output. It touches object.h to put the correct description in a comment.
* CVS patch #477161: New "access" keyword for mmap, from Jay T Miller.Tim Peters2001-11-131-69/+166
| | | | | | | | | | This gives mmap() on Windows the ability to create read-only, write- through and copy-on-write mmaps. A new keyword argument is introduced because the mmap() signatures diverged between Windows and Unix, so while they (now) both support this functionality, there wasn't a way to spell it in a common way without introducing a new spelling gimmick. The old spellings are still accepted, so there isn't a backward- compatibility issue here.
* Remove obsolete e-mail addressAndrew M. Kuchling2001-11-051-1/+1
|
* Fix SF #441664: Python crash on del of a slice of a mmapThomas Wouters2001-07-161-0/+10
| | | | | | Check for slice/item deletion, which calls slice/item assignment with a NULL value, and raise a TypeError instead of coredumping. Bugreport and suggested fix by Alex Martelli.
* Fix new compiler warnings. Also boost "start" from (C) int to long andTim Peters2001-05-141-5/+5
| | | | | | | | return a (C) long: PyArg_ParseTuple and Py_BuildValue may not let us get at the size_t we really want, but C int is clearly too small for a 64-bit box, and both the start parameter and the return value should work for large mapped files even on 32-bit boxes. The code really needs to be rethought from scratch (not by me, though ...).
* Fix the .find() method for memory maps.Greg Stein2001-05-141-3/+12
| | | | | | | | | | 1) it didn't obey the "start" parameter (and when it does, we must validate the value) 2) the return value needs to be an absolute index, rather than relative to some arbitrary point in the file (checking CVS, it appears this method never worked; these changes bring it into line with typical .find() behavior)
* Minor fiddling related toTim Peters2001-05-091-5/+2
| | | | SF patch 416251 2.1c1 mmapmodule: unused vrbl cleanup
* SF but #417587: compiler warnings compiling 2.1.Tim Peters2001-04-211-1/+1
| | | | Repaired *some* of the SGI compiler warnings Sjoerd Mullender reported.
* SF bug 128713: type(mmap_object) blew up on Linux.Tim Peters2001-01-141-3/+4
|
* Part of SF patch #102409 by jlt63 to support building these modulesGuido van Rossum2001-01-101-7/+1
| | | | under CYGWIN as shared libraries (DLLs).
* Windows mmap should (as the docs probably <wink> say) create a mappingTim Peters2001-01-101-2/+2
| | | | | without a name when the optional tagname arg isn't specified. Was actually creating a mapping with an empty string as the name.