| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Issue #26249: PyMem_Malloc() allocator family now uses the pymalloc allocator
rather than system malloc(). Applications calling PyMem_Malloc() without
holding the GIL can now crash: use PYTHONMALLOC=debug environment variable to
validate the usage of memory allocators in your application.
|
|
|
|
| |
Isse #26516.
|
|
|
|
| |
Don't return a void value.
|
|
|
|
|
| |
Issue #26563: Debug hooks on Python memory allocators now raise a fatal error
if functions of the PyMem_Malloc() family are called without holding the GIL.
|
|
|
|
|
|
| |
Issue #26564: _PyObject_DebugDumpAddress() now dumps the traceback where a
memory block was allocated on memory block. Use the tracemalloc module to get
the traceback.
|
|
|
|
|
| |
Issue #26558: The debug hook of PyObject_Malloc() now checks that the GIL is
held when the function is called.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue #26516:
* Add PYTHONMALLOC environment variable to set the Python memory
allocators and/or install debug hooks.
* PyMem_SetupDebugHooks() can now also be used on Python compiled in release
mode.
* The PYTHONMALLOCSTATS environment variable can now also be used on Python
compiled in release mode. It now has no effect if set to an empty string.
* In debug mode, debug hooks are now also installed on Python memory allocators
when Python is configured without pymalloc.
|
| |
|
|\
| |
| |
| | |
bytes on a 32-bit platform.
|
| |
| |
| |
| | |
bytes on a 32-bit platform.
|
| |
| |
| |
| |
| | |
make sure that the code using it will be adapted for the new "calloc" field
(instead of crashing).
|
| | |
|
| |
| |
| |
| | |
redirect.
|
|/
|
|
|
|
| |
PyObject_Calloc(), _PyObject_GC_Calloc(). bytes(int) and bytearray(int) are now
using ``calloc()`` instead of ``malloc()`` for large objects which is faster
and use less memory (until the bytearray buffer is filled with data).
|
|
|
|
|
|
| |
_PyMem_RawMalloc/Realloc/Free, instead of _PyMem_Malloc/Realloc/Free. So it
becomes possible to use the fast pymalloc allocator for the PYMEM_DOMAIN_MEM
domain (PyMem_Malloc/Realloc/Free functions).
|
|
|
|
|
|
| |
This patch appropriately marks known false alarms in the
small object allocator when address sanity checking is
enabled (patch contributed by Dhiru Kholia).
|
| |
|
|
|
|
| |
Best I can tell, the possible values for this aren't documented anywhere.
|
|\
| |
| |
| |
| |
| |
| |
| | |
Issue #18942: sys._debugmallocstats() output was damaged on Windows.
_PyDebugAllocatorStats() called PyOS_snprintf() with a %zd format
code, but MS doesn't support that code. Interpolated
PY_FORMAT_SIZE_T in place of the "z".
|
| |
| |
| |
| |
| |
| | |
_PyDebugAllocatorStats() called PyOS_snprintf() with a %zd format
code, but MS doesn't support that code. Interpolated
PY_FORMAT_SIZE_T in place of the "z".
|
| |
| |
| |
| |
| |
| |
| |
| | |
Don't mark old extra memory dead before calling realloc(). realloc() can fail
and realloc() must not touch the original buffer on failure.
So mark old extra memory dead only on success if the new buffer did not move
(has the same address).
|
| |
| |
| |
| |
| | |
Replace strdup() with _PyMem_RawStrdup() or _PyMem_Strdup(), depending if the
GIL is held or not.
|
| |
| |
| |
| |
| | |
According to VirtualFree() documentation, the size must be zero if the "free
type" is MEM_RELEASE.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
| |
| |
| |
| |
| |
| | |
allocators
The new API require more discussion.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Add a new PyMemAllocators structure
* New functions:
- PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree(): GIL-free memory
allocator functions
- PyMem_GetRawAllocators(), PyMem_SetRawAllocators()
- PyMem_GetAllocators(), PyMem_SetAllocators()
- PyMem_SetupDebugHooks()
- _PyObject_GetArenaAllocators(), _PyObject_SetArenaAllocators()
* Add unit test for PyMem_Malloc(0) and PyObject_Malloc(0)
* Add unit test for new get/set allocators functions
* PyObject_Malloc() now falls back on PyMem_Malloc() instead of malloc() if
size is bigger than SMALL_REQUEST_THRESHOLD, and PyObject_Realloc() falls
back on PyMem_Realloc() instead of realloc()
* PyMem_Malloc() and PyMem_Realloc() now always call malloc() and realloc(),
instead of calling PyObject_Malloc() and PyObject_Realloc() in debug mode
|
| |
| |
| |
| | |
running on valgrind.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| | |
sys.getallocatedblocks() return 0 in that situation.
|
|/
|
|
|
|
| |
number of memory blocks currently allocated.
Also, the ``-R`` option to regrtest uses this function to guard against memory allocation leaks.
|
|
|
|
|
|
| |
integer values, by using Py_uintptr_t instead of size_t.
Patch by Serhiy Storchaka.
|
|
|
|
| |
allocation issues
|
| |
|
|
|
|
|
|
| |
really released
on POSIX systems supporting anonymous memory mappings. Patch by Charles-François Natali.
|
|
|
|
|
| |
free()d memory arenas on glibc-based systems. Patch by Charles-François
Natali.
|
| |
|
|
|
|
|
| |
non-Python managed memory while it is being modified by another thread.
Patch by Matt Bandy.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
|
|
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76644 | benjamin.peterson | 2009-12-02 20:52:39 -0600 (Wed, 02 Dec 2009) | 4 lines
disable pymalloc tricks with the --with-valgrind option #2422
Patch from James Henstridge.
........
|
|
|
|
|
| |
http://bugs.python.org/issue6836
A missing 'const' wasn't detected by Visual Studio.
|
|
|
|
| |
Merging revisions 75103,75104 from trunk to py3k
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r66616 | martin.v.loewis | 2008-09-25 06:12:50 +0200 (Do, 25 Sep 2008) | 2 lines
Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default.
........
|
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r66383 | martin.v.loewis | 2008-09-11 08:53:30 +0200 (Do, 11 Sep 2008) | 3 lines
Issue #3642: Suppress warning in obmalloc when size_t is
larger than uint. Reverts r65975. Reviewed by Brett Cannon.
........
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r65975 | christian.heimes | 2008-08-22 21:34:15 +0200 (Fri, 22 Aug 2008) | 1 line
Changed type of numarenas from uint to size_t to silence a GCC warning on 64bit OSes. Reviewed by Benjamin Peterson.
........
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r65182 | gregory.p.smith | 2008-07-22 06:46:32 +0200 (Tue, 22 Jul 2008) | 7 lines
Issue #2620: Overflow checking when allocating or reallocating memory
was not always being done properly in some python types and extension
modules. PyMem_MALLOC, PyMem_REALLOC, PyMem_NEW and PyMem_RESIZE have
all been updated to perform better checks and places in the code that
would previously leak memory on the error path when such an allocation
failed have been fixed.
........
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r64114 | gregory.p.smith | 2008-06-11 09:41:16 +0200 (mer., 11 juin 2008) | 6 lines
Merge in release25-maint r60793:
Added checks for integer overflows, contributed by Google. Some are
only available if asserts are left in the code, in cases where they
can't be triggered from Python code.
........
|