From b0fcc2c47a34a69c35c1a8031cd0589d3747c1af Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Mon, 18 Nov 2024 14:31:26 +0000 Subject: 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. --- Python/specialize.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Python/specialize.c') 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); } } -- cgit v1.2.3