- Add DEBUG_SAVEALL option. When enabled all garbage objects found by the
collector will be saved in gc.garbage. This is useful for debugging a
program that creates reference cycles.
- Fix else statements in gcmodule.c to conform to Python coding standards.
diff --git a/Doc/lib/libgc.tex b/Doc/lib/libgc.tex
index 5a744c3..a39f755 100644
--- a/Doc/lib/libgc.tex
+++ b/Doc/lib/libgc.tex
@@ -85,7 +85,9 @@
A list of objects which the collector found to be unreachable
but could not be freed (uncollectable objects). Objects that have
\method{__del__()} methods and create part of a reference cycle cause
-the entire reference cycle to be uncollectable.
+the entire reference cycle to be uncollectable. If
+\constant{DEBUG_SAVEALL} is set, then all unreachable objects will
+be added to this list rather than freed.
\end{datadesc}
@@ -117,8 +119,14 @@
set, print information about objects other than instance objects found.
\end{datadesc}
+\begin{datadesc}{DEBUG_SAVEALL}
+When set, all unreachable objects found will be appended to
+\var{garbage} rather than being freed. This can be useful for debugging
+a leaking program.
+\end{datadesc}
+
\begin{datadesc}{DEBUG_LEAK}
The debugging flags necessary for the collector to print
information about a leaking program (equal to \code{DEBUG_COLLECTABLE |
-DEBUG_UNCOLLECTABLE | DEBUG_INSTANCES | DEBUG_OBJECTS}).
+DEBUG_UNCOLLECTABLE | DEBUG_INSTANCES | DEBUG_OBJECTS | DEBUG_SAVEALL}).
\end{datadesc}