summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix strange character in the docstring.Thomas Heller2008-08-191-1/+1
|
* Security patches from Apple: prevent int overflow when allocating memoryNeal Norwitz2008-07-311-1/+1
|
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-18/+18
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-18/+18
|
* Issue 2112. mmap does not raises EnvironmentError no more, butFacundo Batista2008-02-171-1/+4
| | | | a subclass of it. Thanks John Lenton.
* Bug #2111: mmap segfaults when trying to write a block opened with PROT_READChristian Heimes2008-02-151-0/+4
| | | | Thanks to Thomas Herve for the fix.
* Use int for the sign rather than a char. char can be signed or unsigned.Neal Norwitz2008-01-271-1/+1
| | | | It's system dependent. This might fix the problem with test_rfind failing.
* Mostly reformat. Also set an error and return NULL if neither MS_WINDOWSNeal Norwitz2008-01-271-15/+13
| | | | nor UNIX is defined. This may have caused problems on cygwin.
* Cleanup the code a bit. test_rfind is failing on PPC and PPC64 buildbots,Neal Norwitz2008-01-261-7/+7
| | | | this might fix the problem.
* Use Py_TYPE() instead of ->ob_typeChristian Heimes2008-01-231-1/+1
|
* Fix for #1087741 patch.Georg Brandl2008-01-221-1/+1
|
* #1087741: make mmap.mmap the type of mmap objects, not aGeorg Brandl2008-01-211-20/+27
| | | | factory function. Allow it to be subclassed.
* Switch mmap from old Py_FindMethod to new PyObject_GenericGetAttr attribute ↵Georg Brandl2008-01-201-10/+36
| | | | | | access. Fixes #1087735.
* Patch #976880: add mmap .rfind() method, and 'end' paramter to .find().Andrew M. Kuchling2008-01-191-5/+34
| | | | Contributed by John Lenton.
* Check for fd of -1 to save fsync() and fstat() callAndrew M. Kuchling2008-01-101-2/+4
|
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-1/+1
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Fix some compiler warnings for signed comparisons on Unix and Windows.Neal Norwitz2007-10-311-2/+2
|
* Add phuang patch from Issue 708374 which adds offset parameter to mmap module.Travis E. Oliphant2007-10-231-34/+75
|
* Improve extended slicing support in builtin types and classes. Specifically:Thomas Wouters2007-08-281-1/+151
| | | | | | | | | | | | | | | | | | | | - Specialcase extended slices that amount to a shallow copy the same way as is done for simple slices, in the tuple, string and unicode case. - Specialcase step-1 extended slices to optimize the common case for all involved types. - For lists, allow extended slice assignment of differing lengths as long as the step is 1. (Previously, 'l[:2:1] = []' failed even though 'l[:2] = []' and 'l[:2:None] = []' do not.) - Implement extended slicing for buffer, array, structseq, mmap and UserString.UserString. - Implement slice-object support (but not non-step-1 slice assignment) for UserString.MutableString. - Add tests for all new functionality.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-3/+2
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Alexander Belopolsky pointed out that pos is a size_tNeal Norwitz2006-08-221-1/+1
|
* Fix a couple of ssize-t issues reported by Alexander Belopolsky on python-devNeal Norwitz2006-08-211-1/+1
|
* Get rid of compiler warningNeal Norwitz2006-08-131-2/+2
|
* Check return result of PyModule_GetDict().Neal Norwitz2006-08-131-22/+24
| | | | | Fix a bunch of refleaks in the init of the module. This would only be found when running python -v.
* Patch #1538606, Patch to fix __index__() clipping.Neal Norwitz2006-08-121-22/+8
| | | | | | | I modified this patch some by fixing style, some error checking, and adding XXX comments. This patch requires review and some changes are to be expected. I'm checking in now to get the greatest possible review and establish a baseline for moving forward. I don't want this to hold up release if possible.
* Patch #1495999: Part two of Windows CE changes.Martin v. Löwis2006-06-101-0/+3
| | | | | | - update header checks, using autoconf - provide dummies for getenv, environ, and GetVersion - adjust MSC_VER check in socketmodule.c
* Make use of METH_O and METH_NOARGS where possible.Georg Brandl2006-05-291-20/+10
| | | | Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
* Correct some value converting strangenesses.Georg Brandl2006-05-291-3/+3
|
* 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.