summaryrefslogtreecommitdiff
path: root/Misc/SpecialBuilds.txt
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-03-23 02:51:01 +0000
committerTim Peters <tim.peters@gmail.com>2003-03-23 02:51:01 +0000
commit2db0ef0bd804993da709a2d3b7f8b9c70d7066ee (patch)
tree577774432e53e6a9e3abfaaf6416c7091c4572b0 /Misc/SpecialBuilds.txt
parent07a33169d8671add27b6fd9d46617197d6390fd1 (diff)
downloadcpython-2db0ef0bd804993da709a2d3b7f8b9c70d7066ee.tar.gz
When Py_TRACE_REFS is defined, a list of all live objects is maintained in
a doubly-linked list, exposed by sys.getobjects(). Unfortunately, it's not really all live objects, and it seems my fate to bump into programs where sys.gettotalrefcount() keeps going up but where the reference leaks aren't accounted for by anything in the list of all objects. This patch helps a little: if COUNT_ALLOCS is also defined, from now on type objects will also appear in this list, provided at least one object of a type has been allocated.
Diffstat (limited to 'Misc/SpecialBuilds.txt')
-rw-r--r--Misc/SpecialBuilds.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/Misc/SpecialBuilds.txt b/Misc/SpecialBuilds.txt
index a4226c92ae..a3d35586f4 100644
--- a/Misc/SpecialBuilds.txt
+++ b/Misc/SpecialBuilds.txt
@@ -34,10 +34,14 @@ Py_TRACE_REFS introduced in 1.4
Turn on heavy reference debugging. This is major surgery. Every PyObject
grows two more pointers, to maintain a doubly-linked list of all live
-heap-allocated objects (note that, e.g., most builtin type objects are not
-in this list, as they're statically allocated). Note that because the
-fundamental PyObject layout changes, Python modules compiled with
-Py_TRACE_REFS are incompatible with modules compiled without it.
+heap-allocated objects. Most builtin type objects are not in this list,
+as they're statically allocated. Starting in Python 2.3, if COUNT_ALLOCS
+(see below) is also defined, a static type object T does appear in this
+list if at least one object of type T has been created.
+
+Note that because the fundamental PyObject layout changes, Python modules
+compiled with Py_TRACE_REFS are incompatible with modules compiled without
+it.
Py_TRACE_REFS implies Py_REF_DEBUG.
@@ -171,6 +175,11 @@ because of this; this was fixed in 2.2.2. Use of COUNT_ALLOCS makes
all heap-allocated type objects immortal, except for those for which no
object of that type is ever allocated.
+Starting with Python 2.3, If Py_TRACE_REFS is also defined, COUNT_ALLOCS
+arranges to ensure that the type object for each allocated object
+appears in the doubly-linked list of all objects maintained by
+Py_TRACE_REFS.
+
Special gimmicks:
sys.getcounts()