summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Issue #18408: Fix zlib.compressobj() to handle PyThread_allocate_lock() failureVictor Stinner2013-07-081-0/+4
| | | | (MemoryError).
* Issue #18408: Fix ConvParam() of the ctypes module to handle paramfunc failureVictor Stinner2013-07-081-0/+2
| | | | (MemoryError).
* fix indentationVictor Stinner2013-07-081-13/+13
|
* Issue #18408: PyObject_GC_NewVar() now raises SystemError exception if nitemsVictor Stinner2013-07-081-2/+9
| | | | is negative
* gcmodule.c: strip trailing spacesVictor Stinner2013-07-081-7/+7
|
* Issue #18203: Add _PyMem_RawStrdup() and _PyMem_Strdup()Victor Stinner2013-07-075-20/+21
| | | | | Replace strdup() with _PyMem_RawStrdup() or _PyMem_Strdup(), depending if the GIL is held or not.
* Issue #18227: pyexpat now uses a static XML_Memory_Handling_Suite. ↵Christian Heimes2013-07-071-6/+6
| | | | cElementTree uses the same approach since at least Python 2.6
* Issue #18227: "Free" function of bz2, lzma and zlib modules has no return ↵Victor Stinner2013-07-073-3/+3
| | | | value (void)
* Issue #18203: Replace malloc() with PyMem_Malloc() in _ssl for the passwordVictor Stinner2013-07-071-4/+4
|
* Issue #18227: Use PyMem_RawAlloc() in bz2, lzma and zlib modulesVictor Stinner2013-07-073-8/+77
|
* Fix a compiler warning in posix_sendfile() on FreeBSD:Victor Stinner2013-07-071-2/+3
| | | | | Modules/posixmodule.c: In function 'posix_sendfile': Modules/posixmodule.c:7700: warning: ISO C90 forbids mixed declarations and code
* Issue #18203: Replace malloc() with PyMem_Malloc() in Python modulesVictor Stinner2013-07-079-53/+50
| | | | | Replace malloc() with PyMem_Malloc() when the GIL is held, or with PyMem_RawMalloc() otherwise.
* Issue #18203: Replace malloc() with PyMem_RawMalloc() at Python initializationVictor Stinner2013-07-073-27/+30
| | | | | | | * Replace malloc() with PyMem_RawMalloc() * Replace PyMem_Malloc() with PyMem_RawMalloc() where the GIL is not held. * _Py_char2wchar() now returns a buffer allocated by PyMem_RawMalloc(), instead of PyMem_Malloc()
* Fix #ifdefRaymond Hettinger2013-07-071-1/+1
|
* Use macros for marking and checking endpoints in the doubly-linked list of ↵Raymond Hettinger2013-07-071-47/+81
| | | | | | | | | | blocks. * Add comment explaining the endpoint checks * Only do the checks in a debug build * Simplify newblock() to only require a length argument and leave the link updates to the calling code. * Also add comment for the freelisting logic.
* mergeRaymond Hettinger2013-07-071-0/+163
|\
| * Issue #3329: Implement the PEP 445Victor Stinner2013-07-071-0/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new enum: * PyMemAllocatorDomain Add new structures: * PyMemAllocator * PyObjectArenaAllocator Add new functions: * PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree() * PyMem_GetAllocator(), PyMem_SetAllocator() * PyObject_GetArenaAllocator(), PyObject_SetArenaAllocator() * PyMem_SetupDebugHooks() Changes: * PyMem_Malloc()/PyObject_Realloc() now always call malloc()/realloc(), instead of calling PyObject_Malloc()/PyObject_Realloc() in debug mode. * PyObject_Malloc()/PyObject_Realloc() now falls back to PyMem_Malloc()/PyMem_Realloc() for allocations larger than 512 bytes. * Redesign debug checks on memory block allocators as hooks, instead of using C macros
* | Improve variable names in deque_count()Raymond Hettinger2013-07-071-8/+8
|/
* Apply the PyObject_VAR_HEAD and Py_SIZE macrosRaymond Hettinger2013-07-061-40/+39
| | | | to be consistent with practices in other modules.
* Refactor deque_traverse().Raymond Hettinger2013-07-061-6/+6
| | | | | Hoist conditional expression out of the loop. Use rightblock as the guard instead of checking for NULL.
* Remove unnecessary branches from count() and reverse().Raymond Hettinger2013-07-061-6/+3
|
* Speed-up deque indexing by changing the deque block length to a power of two.Raymond Hettinger2013-07-061-1/+1
| | | | | | | | | | | | | | | The division and modulo calculation in deque_item() can be compiled to fast bitwise operations when the BLOCKLEN is a power of two. Timing before: ~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]' 10000000 loops, best of 7: 0.0627 usec per loop Timing after: ~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]' 10000000 loops, best of 7: 0.0581 usec per loop
* (Merge 3.3) Issue #18343: faulthandler.register() now keeps the previous signalVictor Stinner2013-07-011-1/+2
|\ | | | | | | | | handler when the function is called twice, so faulthandler.unregister() restores correctly the original signal handler.
| * Issue #18343: faulthandler.register() now keeps the previous signal handlerVictor Stinner2013-07-011-1/+2
| | | | | | | | | | when the function is called twice, so faulthandler.unregister() restores correctly the original signal handler.
* | Singular form just like the other error message.Christian Heimes2013-07-011-1/+1
|\ \ | |/
| * Singular form just like the other error message.Christian Heimes2013-07-011-1/+1
| |
* | Issue #18339: Negative ints keys in unpickler.memo dict no longer cause aChristian Heimes2013-07-011-0/+5
|\ \ | |/ | | | | segfault inside the _pickle C extension.
| * Issue #18339: Negative ints keys in unpickler.memo dict no longer cause aChristian Heimes2013-07-011-0/+5
| | | | | | | | segfault inside the _pickle C extension.
* | Fix segfault in pyexpat.c caused by 84375Christian Heimes2013-06-291-1/+1
| | | | | | | | u can be NULL, use XDECREF
* | Fix resource leak in pickle moduleChristian Heimes2013-06-291-1/+3
| | | | | | | | | | CID 983309 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable unicode_str going out of scope leaks the storage it points to.
* | Fix NULL ptr dereferencing in local_timezone(). nameo can be NULLChristian Heimes2013-06-291-1/+1
| | | | | | | | | | CID 1040362 (#1 of 1): Explicit null dereferenced (FORWARD_NULL) var_deref_op: Dereferencing null pointer _py_decref_tmp.
* | Fix memory leak in pyexpat PyUnknownEncodingHandlerChristian Heimes2013-06-291-1/+3
| | | | | | | | | | CID 1040367 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable u going out of scope leaks the storage it points to.
* | Fix os.confstr(): the result type of the C function is size_t, not intVictor Stinner2013-06-251-2/+2
| |
* | Fix time.mktime() and datetime.datetime.timestamp() on AIXVictor Stinner2013-06-252-4/+20
| | | | | | | | | | | | On AIX, the C function mktime() alwaysd sets tm_wday, even on error. So tm_wday cannot be used as a sentinel to detect an error, we can only check if the result is (time_t)-1.
* | (Merge 3.3) Fix time.strftime("%Y") on AIX: raise a ValueError for year > 9999Victor Stinner2013-06-251-1/+1
|\ \ | |/ | | | | time.strtime("%Y") returned "2345" when formatting year 12345.
| * Fix time.strftime("%Y") on AIX: raise a ValueError for year > 9999Victor Stinner2013-06-251-1/+1
| | | | | | | | time.strtime("%Y") returned "2345" when formatting year 12345.
* | _ssl.c: strip trailing spacesVictor Stinner2013-06-241-3/+3
| |
* | (Merge 3.3) Issue #18135: ssl.SSLSocket.write() now raises an OverflowError ifVictor Stinner2013-06-241-2/+7
|\ \ | |/ | | | | | | | | the input string in longer than 2 gigabytes, and ssl.SSLContext.load_cert_chain() raises a ValueError if the password is longer than 2 gigabytes. The ssl module does not support partial write.
| * Issue #18135: ssl.SSLSocket.write() now raises an OverflowError if the inputVictor Stinner2013-06-241-2/+7
| | | | | | | | | | | | string in longer than 2 gigabytes, and ssl.SSLContext.load_cert_chain() raises a ValueError if the password is longer than 2 gigabytes. The ssl module does not support partial write.
* | If MS_WIN64 is defined, MS_WINDOWS is also defined: #ifdef can be simplified.Victor Stinner2013-06-244-16/+16
| |
* | Issue #9566: recv(), recvfrom(), send(), sendall() and sendto() methodsVictor Stinner2013-06-241-5/+32
| | | | | | | | | | | | | | of socket.socket objects now truncate the input buffer to INT_MAX bytes on Windows to avoid an integer overflow. (sendall() still send the whole buffer.)
* | Issue #9566: _winapi.WriteFile() now truncates length to DWORD_MAX (4294967295)Victor Stinner2013-06-241-2/+5
| |
* | Issue #9566: zlib: Explicit cast to unsigned int to fix a compiler warning ↵Victor Stinner2013-06-241-4/+4
| | | | | | | | on Windows x64
* | Issue #9566: _io: Use Py_SAFE_DOWNCAST for fix a compiler warning on Windows x64Victor Stinner2013-06-241-1/+1
| |
* | mergeRaymond Hettinger2013-06-233-34/+8
|\ \
| * | Issue #11016: Don't define macros and constants that are already set by pyport.hChristian Heimes2013-06-231-31/+5
| | |
| * | Define S_IFMT and S_IFLNK in pyport.h so posixmodule.c can use named ↵Christian Heimes2013-06-231-2/+2
| | | | | | | | | | | | | | | | | | constants instead of arbitrary looking numbers.
| * | Check for correct macro, code uses S_ISDIR().Christian Heimes2013-06-231-1/+1
| |\ \ | | |/
| | * Check for correct macro, code uses S_ISDIR().Christian Heimes2013-06-231-1/+1
| | |
* | | Misc improvements to collections.deque()Raymond Hettinger2013-06-231-72/+93
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Clarified comment on the impact of BLOCKLEN on deque_index (with a power-of-two, the division and modulo computations are done with a right-shift and bitwise-and). * Clarified comment on the overflow check to note that it is general and not just applicable the 64-bit builds. * In deque._rotate(), the "deque->" indirections are factored-out of the loop (loop invariant code motion), leaving the code cleaner looking and slightly faster. * In deque._rotate(), replaced the memcpy() with an equivalent loop. That saved the memcpy setup time and allowed the pointers to move in their natural leftward and rightward directions. See comparative timings at: http://pastebin.com/p0RJnT5N