Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 72128e2

Browse files
committed
wip: include # of collected in debug log
1 parent 2635fe0 commit 72128e2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Python/gc_free_threading.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,10 +1077,6 @@ deduce_unreachable_heap(PyInterpreterState *interp,
10771077
// incoming references.
10781078
gc_visit_heaps(interp, &update_refs, &state->base);
10791079

1080-
#if WITH_GC_TIMING_STATS
1081-
fprintf(gc_log, "gc alive %d immortal %d checked %d gc %d\n", num_alive, num_immortal, num_checked, num_gc);
1082-
#endif
1083-
10841080
#ifdef GC_DEBUG
10851081
// Check that all objects are marked as unreachable and that the computed
10861082
// reference count difference (stored in `ob_tid`) is non-negative.
@@ -1837,6 +1833,11 @@ gc_collect_main(PyThreadState *tstate, int generation, _PyGC_Reason reason)
18371833
}
18381834
#endif
18391835

1836+
#if WITH_GC_TIMING_STATS
1837+
fprintf(gc_log, "gc alive %d collected %ld checked %d gc %d\n", num_alive, m, num_checked, num_gc);
1838+
fflush(gc_log);
1839+
#endif
1840+
18401841
if (PyDTrace_GC_DONE_ENABLED()) {
18411842
PyDTrace_GC_DONE(n + m);
18421843
}

0 commit comments

Comments
 (0)