]> granicus.if.org Git - python/commit
bpo-35053: Enhance tracemalloc to trace free lists (GH-10063)
authorVictor Stinner <vstinner@redhat.com>
Thu, 25 Oct 2018 11:31:16 +0000 (13:31 +0200)
committerGitHub <noreply@github.com>
Thu, 25 Oct 2018 11:31:16 +0000 (13:31 +0200)
commit9e00e80e213ebc37eff89ce72102c1f928ebc133
tree50b24d69615a7994aeb4d776adc8666fcec5aafd
parentd7c3e5f0e89cb807093e33165815c8bbd3c00f4b
bpo-35053: Enhance tracemalloc to trace free lists (GH-10063)

tracemalloc now tries to update the traceback when an object is
reused from a "free list" (optimization for faster object creation,
used by the builtin list type for example).

Changes:

* Add _PyTraceMalloc_NewReference() function which tries to update
  the Python traceback of a Python object.
* _Py_NewReference() now calls _PyTraceMalloc_NewReference().
* Add an unit test.
Include/object.h
Include/pymem.h
Lib/test/test_tracemalloc.py
Misc/NEWS.d/next/Library/2018-10-23-18-58-12.bpo-35053.G82qwh.rst [new file with mode: 0644]
Modules/_tracemalloc.c
Objects/object.c
Objects/obmalloc.c