summaryrefslogtreecommitdiffstats
path: root/Modules/_tracemalloc.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #20186: Regenerated Argument Clinic.Serhiy Storchaka2017-02-051-1/+1
|
* Issue #20186: Converted the tracemalloc module to Argument Clinic.Serhiy Storchaka2017-02-041-102/+123
| | | | Based on patch by Georg Brandl.
* replace PY_SIZE_MAX with SIZE_MAXBenjamin Peterson2016-09-071-2/+2
|
* replace Py_(u)intptr_t with the c99 standard typesBenjamin Peterson2016-09-061-15/+15
|
* Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-301-1/+1
|
* - make some internal symbols staticdoko@ubuntu.com2016-05-171-1/+1
|
* Issue #26778: Fixed "a/an/and" typos in code comment, documentation and errorSerhiy Storchaka2016-04-171-1/+1
|\ | | | | | | messages.
| * Issue #26778: Fixed "a/an/and" typos in code comment and documentation.Serhiy Storchaka2016-04-171-1/+1
| |
* | Issue #15984: Merge PyUnicode doc from 3.5Martin Panter2016-04-151-1/+1
|\ \ | |/
| * Correct “an” → “a” with “Unicode”, “user”, “UTF”, etcMartin Panter2016-04-151-1/+1
| | | | | | | | This affects documentation, code comments, and a debugging messages.
* | _tracemalloc: use compact key for tracesVictor Stinner2016-03-231-1/+61
| | | | | | | | | | | | Issue #26588: Optimize memory footprint of _tracemalloc before non-zero domain is used. Start with compact key (Py_uintptr_t) and also switch to pointer_t key when the first memory block with a non-zero domain is tracked.
* | Cleanup hashtable.hVictor Stinner2016-03-231-26/+24
| | | | | | | | | | | | | | | | | | | | | | | | Issue #26588: * Pass the hash table rather than the key size to hash and compare functions * _Py_HASHTABLE_READ_KEY() and _Py_HASHTABLE_ENTRY_READ_KEY() macros now expect the hash table as the first parameter, rather than the key size * tracemalloc_get_traces_fill(): use _Py_HASHTABLE_ENTRY_READ_DATA() rather than pointer dereference * Remove the _Py_HASHTABLE_ENTRY_WRITE_PKEY() macro * Move "PKEY" and "PDATA" macros inside hashtable.c
* | Issue #26588:Victor Stinner2016-03-231-11/+27
| | | | | | | | | | | | | | * Optimize tracemalloc_add_trace(): modify hashtable entry data (trace) if the memory block is already tracked, rather than trying to remove the old trace and then add a new trace. * Add _Py_HASHTABLE_ENTRY_WRITE_DATA() macro
* | Issue #26588:Victor Stinner2016-03-231-1/+1
| | | | | | | | | | | | | | | | * _Py_HASHTABLE_ENTRY_DATA: change type from "char *" to "const void *" * Add _Py_HASHTABLE_ENTRY_WRITE_PKEY() macro * Rename _Py_HASHTABLE_ENTRY_WRITE_DATA() macro to _Py_HASHTABLE_ENTRY_WRITE_PDATA() * Add _Py_HASHTABLE_ENTRY_WRITE_DATA() macro
* | Issue #26588: Optimize tracemalloc_realloc()Victor Stinner2016-03-231-1/+6
| | | | | | | | No need to remove the old trace if the memory block didn't move.
* | Merge 3.5Victor Stinner2016-03-221-15/+1
|\ \ | |/
| * Enhance _tracemalloc debug modeVictor Stinner2016-03-221-1/+1
| | | | | | | | Issue #26588: Enhance assertion in set_reentrant()
| * Fix _tracemalloc start/stopVictor Stinner2016-03-221-14/+0
| | | | | | | | | | | | | | | | | | Issue #26588: Fix _tracemalloc start/stop: don't play with the reentrant flag. set_reentrant(1) fails with an assertion error if tracemalloc_init() is called first in a thread A and tracemalloc_start() is called second in a thread B. The tracemalloc is imported in a thread A. Importing the module calls tracemalloc_init(). tracemalloc.start() is called in a thread B.
* | Issue #26588: remove debug traces from _tracemalloc.Victor Stinner2016-03-221-64/+5
| |
* | Issue #26588: more debug tracesVictor Stinner2016-03-221-1/+6
| |
* | Issue #26588: Don't call tracemalloc_init() at module initilizationVictor Stinner2016-03-221-0/+2
| | | | | | | | So it's possible to get debug messages in test_tracemalloc.
* | Issue #26588: one more assertionVictor Stinner2016-03-221-0/+1
| |
* | Add assertions on tracemalloc_reentrant_keyVictor Stinner2016-03-221-2/+8
| | | | | | | | Issue #26588.
* | Issue #26588: more assertionsVictor Stinner2016-03-221-2/+23
| |
* | Issue #26588: add debug tracesVictor Stinner2016-03-221-5/+35
| | | | | | | | Try to debug random failure on buildbots.
* | Add C functions _PyTraceMalloc_Track()Victor Stinner2016-03-221-11/+71
| | | | | | | | | | | | | | | | Issue #26530: * Add C functions _PyTraceMalloc_Track() and _PyTraceMalloc_Untrack() to track memory blocks using the tracemalloc module. * Add _PyTraceMalloc_GetTraceback() to get the traceback of an object.
* | tracemalloc now supports domainsVictor Stinner2016-03-221-53/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #26588: * The _tracemalloc now supports tracing memory allocations of multiple address spaces (domains). * Add domain parameter to tracemalloc_add_trace() and tracemalloc_remove_trace(). * tracemalloc_add_trace() now starts by removing the previous trace, if any. * _tracemalloc._get_traces() now returns a list of (domain, size, traceback_frames): the domain is new. * Add tracemalloc.DomainFilter * tracemalloc.Filter: add an optional domain parameter to the constructor and a domain attribute * Sublte change: use Py_uintptr_t rather than void* in the traces key. * Add tracemalloc_config.use_domain, currently hardcoded to 1
* | Simplify implementation of hashtable.cVictor Stinner2016-03-221-6/+8
| | | | | | | | | | | | | | | | | | | | | | Issue #26588: Remove copy_data, free_data and get_data_size callbacks from hashtable.h. These callbacks are not used in Python and makes the code more complex. Remove also the _Py_HASHTABLE_ENTRY_DATA_AS_VOID_P() macro which uses an unsafe pointer dereference (can cause memory alignment issue). Replace the macro usage with _Py_HASHTABLE_ENTRY_READ_DATA() which is implemented with the safe memcpy() function.
* | Issue #26588: Fix compilation warning on WindowsVictor Stinner2016-03-211-1/+1
| |
* | hashtable.h now supports keys of any sizeVictor Stinner2016-03-211-37/+68
| | | | | | | | | | | | Issue #26588: hashtable.h now supports keys of any size, not only sizeof(void*). It allows to support key larger than sizeof(void*), but also to use less memory for key smaller than sizeof(void*).
* | Ooops, revert changeset ea9efa06c137Victor Stinner2016-03-211-138/+48
| | | | | | | | | | | | | | | | | | | | | | Change pushed by mistake, the patch is still under review :-/ """ _tracemalloc: add domain to trace keys * hashtable.h: key has now a variable size * _tracemalloc uses (pointer: void*, domain: unsigned int) as key for traces """
* | _tracemalloc: add domain to trace keysVictor Stinner2016-03-181-48/+138
| | | | | | | | | | * hashtable.h: key has now a variable size * _tracemalloc uses (pointer: void*, domain: unsigned int) as key for traces
* | On memory error, dump the memory block tracebackVictor Stinner2016-03-151-11/+56
| | | | | | | | | | | | 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.
* | Merge 3.5 (_tracemalloc)Victor Stinner2016-03-151-17/+7
|\ \ | |/
| * _tracemalloc: store lineno as unsigned intVictor Stinner2016-03-151-17/+7
| | | | | | | | Issue #26564. Cleanup the code, lineno is never negative.
* | _tracemalloc: filename cannot be NULLVictor Stinner2016-03-151-2/+2
| |
* | Issue #26558: Remove useless check in tracemallocVictor Stinner2016-03-141-4/+0
|/ | | | | The first instruction of tracemalloc_add_trace() is traceback_new() which already checks the GIL.
* Merge 3.4 (tracemalloc typo)Victor Stinner2015-03-181-1/+1
|\
| * _tracemalloc.c: Fix typoVictor Stinner2015-03-181-1/+1
| |
* | Removed duplicated words in in comments and docs.Serhiy Storchaka2014-12-011-1/+1
|\ \ | |/
| * Removed duplicated words in in comments and docs.Serhiy Storchaka2014-12-011-1/+1
| |
* | Issue #22156: simplify _tracemalloc.c, use an int for the MAX_NFRAME constantVictor Stinner2014-08-161-6/+6
| |
* | Issue #22156: Fix some "comparison between signed and unsigned integers"Victor Stinner2014-08-151-5/+5
| | | | | | | | compiler warnings in the Modules/ subdirectory.
* | Issue #21233: Rename the C structure "PyMemAllocator" to "PyMemAllocatorEx" toVictor Stinner2014-06-021-11/+11
| | | | | | | | | | make sure that the code using it will be adapted for the new "calloc" field (instead of crashing).
* | Issue #21639: Fix a division by zero in tracemalloc on calloc(0, 0). TheVictor Stinner2014-06-021-1/+1
|\ \ | |/ | | | | | | | | | | regression was introduced recently with the introduction of the new "calloc" functions (PyMem_RawCalloc, PyMem_Calloc, PyObject_Calloc). Add also a unit test to check for the non-regression.
* | Issue #21490: Add new C macros: Py_ABS() and Py_STRINGIFY()Victor Stinner2014-05-141-3/+0
| | | | | | | | | | Keep _Py_STRINGIZE() in PC/pyconfig.h to not introduce a dependency between pyconfig.h and pymacros.h.
* | Issue #21233: Add new C functions: PyMem_RawCalloc(), PyMem_Calloc(),Victor Stinner2014-05-021-10/+47
|/ | | | | | 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).
* Issue #21036: Fix typo in macro nameVictor Stinner2014-03-241-1/+1
| | | | _PY_HASHTABLE_ENTRY_DATA => _Py_HASHTABLE_ENTRY_DATA
* Issue #20354: Fix alignment issue in the tracemalloc module on 64-bitVictor Stinner2014-02-011-1/+2
| | | | | | | | platforms. Bug seen on 64-bit Linux when using "make profile-opt". Only align the "frame_t" structure on 32-bit when Visual Studio is used. Before the alignment to 32-bit was applied to the whole file any compiler supporting "#pragma pack(4)" which includes GCC.
* tracemalloc: fix usage of strtol(), value can be LONG_MIN or LONG_MAX on ERANGEVictor Stinner2013-12-161-1/+2
|