aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/specialize.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-11-18 14:31:26 +0000
committerGitHub <noreply@github.com>2024-11-18 14:31:26 +0000
commitb0fcc2c47a34a69c35c1a8031cd0589d3747c1af (patch)
treeaa9d4bfaf49dca8d3ce47aa18a03cf2d5374a8e2 /Python/specialize.c
parenta1d9c8aa800dd7c9eb634f89646be10e9cfc9c8d (diff)
downloadcpython-b0fcc2c47a34a69c35c1a8031cd0589d3747c1af.tar.gz
cpython-b0fcc2c47a34a69c35c1a8031cd0589d3747c1af.zip
GH-126491: GC: Mark objects reachable from roots before doing cycle collection (GH-126502)
* Mark almost all reachable objects before doing collection phase * Add stats for objects marked * Visit new frames before each increment * Remove lazy dict tracking * Update docs * Clearer calculation of work to do.
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index 4c8cf8534b3..dbdff197ac7 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -230,6 +230,8 @@ print_gc_stats(FILE *out, GCStats *stats)
for (int i = 0; i < NUM_GENERATIONS; i++) {
fprintf(out, "GC[%d] collections: %" PRIu64 "\n", i, stats[i].collections);
fprintf(out, "GC[%d] object visits: %" PRIu64 "\n", i, stats[i].object_visits);
+ fprintf(out, "GC[%d] objects reachable from roots: %" PRIu64 "\n", i, stats[i].objects_transitively_reachable);
+ fprintf(out, "GC[%d] objects not reachable from roots: %" PRIu64 "\n", i, stats[i].objects_not_transitively_reachable);
fprintf(out, "GC[%d] objects collected: %" PRIu64 "\n", i, stats[i].objects_collected);
}
}