[Python-checkins] python/dist/src/Misc SpecialBuilds.txt,1.13,1.14

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sat, 22 Mar 2003 18:51:03 -0800


Update of /cvsroot/python/python/dist/src/Misc
In directory sc8-pr-cvs1:/tmp/cvs-serv18845/Misc

Modified Files:
	SpecialBuilds.txt 
Log Message:
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.


Index: SpecialBuilds.txt
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/SpecialBuilds.txt,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** SpecialBuilds.txt	5 Feb 2003 23:12:57 -0000	1.13
--- SpecialBuilds.txt	23 Mar 2003 02:51:01 -0000	1.14
***************
*** 35,42 ****
  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.
  
  Py_TRACE_REFS implies Py_REF_DEBUG.
--- 35,46 ----
  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.  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,174 ****
--- 175,183 ----
  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: