| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* Use Py_DECREF() instead of PyObject_GC_Del() to release correctly all
resources
* Raise MemoryError on memory allocation failure
|
|
|
|
| |
allocation failure
|
|
|
|
| |
Handle PyLong_FromLong() and PyUnicode_FromString() failures
|
|
|
|
|
|
| |
on memory allocation failure
Instead of ignoring the memory allocation failure and create invalid objects.
|
|
|
|
| |
failures
|
|
|
|
|
|
| |
allocating a bigger table failed
PyMemoTable destructor does crash if mt_table is NULL.
|
|
|
|
| |
the newly created pickler, and not PyObject_GC_Del().
|
|
|
|
|
|
|
|
|
|
| |
* create_new_element() initializes all attributes before handling errors,
to fix a crash in the destructor
* create_new_element() calls PyObject_GC_Del() on error, instead of
PyObject_Del(), because the object was created by PyObject_GC_New()
* subelement() now handles create_new_element() failure
* element_getattro() now handles element_get_text() failure
* makeuniversal() now handles PyBytes_FromStringAndSize() failure
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
attributes before handling errors
_Pickler_New() now calls PyObject_GC_Del() instead of Py_DECREF() on error,
because the pickle object is created using PyObject_GC_New().
Fix a crash in the destructor when an attribute is not initiallized.
|
|\
| |
| |
| |
| |
| | |
do with byte strings.
Added tests for Tcl.split() and Tcl.splitline().
|
| |
| |
| |
| |
| |
| | |
do with byte strings.
Added tests for Tcl.split() and Tcl.splitline().
|
| |
| |
| |
| | |
not to stderr. Patch by Berker Peksag and Michael Dickens.
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Patch by Andrew Rowe.
|
| | |
|
| |
| |
| |
| | |
in set2list()
|
| |
| |
| |
| |
| | |
_PyBytes_Resize(&v, new_size) sets v to NULL on error, so v cannot be used
anymore. Replace "Py_DECREF(v); v = NULL;" with "Py_CLEAR(v);".
|
| |
| |
| |
| | |
(MemoryError).
|
| |
| |
| |
| | |
(MemoryError).
|
| | |
|
| |
| |
| |
| | |
is negative
|
| | |
|
| |
| |
| |
| |
| | |
Replace strdup() with _PyMem_RawStrdup() or _PyMem_Strdup(), depending if the
GIL is held or not.
|
| |
| |
| |
| | |
cElementTree uses the same approach since at least Python 2.6
|
| |
| |
| |
| | |
value (void)
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Modules/posixmodule.c: In function 'posix_sendfile':
Modules/posixmodule.c:7700: warning: ISO C90 forbids mixed declarations and code
|
| |
| |
| |
| |
| | |
Replace malloc() with PyMem_Malloc() when the GIL is held, or with
PyMem_RawMalloc() otherwise.
|
| |
| |
| |
| |
| |
| |
| | |
* 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()
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|/ / |
|
| |
| |
| |
| | |
to be consistent with practices in other modules.
|
| |
| |
| |
| |
| | |
Hoist conditional expression out of the loop.
Use rightblock as the guard instead of checking for NULL.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \
| |/
| |
| |
| | |
handler when the function is called twice, so faulthandler.unregister()
restores correctly the original signal handler.
|
| |
| |
| |
| |
| | |
when the function is called twice, so faulthandler.unregister() restores
correctly the original signal handler.
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/
| |
| | |
segfault inside the _pickle C extension.
|
| |
| |
| |
| | |
segfault inside the _pickle C extension.
|
| |
| |
| |
| | |
u can be NULL, use XDECREF
|
| |
| |
| |
| |
| | |
CID 983309 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable unicode_str going out of scope leaks the storage it points to.
|
| |
| |
| |
| |
| | |
CID 1040362 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
var_deref_op: Dereferencing null pointer _py_decref_tmp.
|