@@ -488,7 +488,7 @@ update_refs(PyGC_Head *containers)
488488{
489489 PyGC_Head * next ;
490490 PyGC_Head * gc = GC_NEXT (containers );
491- Py_ssize_t visited = 0 ;
491+ Py_ssize_t candidates = 0 ;
492492
493493 while (gc != containers ) {
494494 next = GC_NEXT (gc );
@@ -520,9 +520,9 @@ update_refs(PyGC_Head *containers)
520520 */
521521 _PyObject_ASSERT (op , gc_get_refs (gc ) != 0 );
522522 gc = next ;
523- visited ++ ;
523+ candidates ++ ;
524524 }
525- return visited ;
525+ return candidates ;
526526}
527527
528528/* A traversal callback for subtract_refs. */
@@ -1251,7 +1251,7 @@ deduce_unreachable(PyGC_Head *base, PyGC_Head *unreachable) {
12511251 * refcount greater than 0 when all the references within the
12521252 * set are taken into account).
12531253 */
1254- Py_ssize_t visited = update_refs (base ); // gc_prev is used for gc_refs
1254+ Py_ssize_t candidates = update_refs (base ); // gc_prev is used for gc_refs
12551255 subtract_refs (base );
12561256
12571257 /* Leave everything reachable from outside base in base, and move
@@ -1292,7 +1292,7 @@ deduce_unreachable(PyGC_Head *base, PyGC_Head *unreachable) {
12921292 move_unreachable (base , unreachable ); // gc_prev is pointer again
12931293 validate_list (base , collecting_clear_unreachable_clear );
12941294 validate_list (unreachable , collecting_set_unreachable_set );
1295- return visited ;
1295+ return candidates ;
12961296}
12971297
12981298/* Handle objects that may have resurrected after a call to 'finalize_garbage', moving
@@ -1368,9 +1368,9 @@ static void
13681368add_stats (GCState * gcstate , int gen , struct gc_collection_stats * stats )
13691369{
13701370 gcstate -> generation_stats [gen ].duration += stats -> duration ;
1371- gcstate -> generation_stats [gen ].visited += stats -> visited ;
13721371 gcstate -> generation_stats [gen ].collected += stats -> collected ;
13731372 gcstate -> generation_stats [gen ].uncollectable += stats -> uncollectable ;
1373+ gcstate -> generation_stats [gen ].candidates += stats -> candidates ;
13741374 gcstate -> generation_stats [gen ].collections += 1 ;
13751375}
13761376
@@ -1759,7 +1759,7 @@ gc_collect_region(PyThreadState *tstate,
17591759 assert (!_PyErr_Occurred (tstate ));
17601760
17611761 gc_list_init (& unreachable );
1762- stats -> visited = deduce_unreachable (from , & unreachable );
1762+ stats -> candidates = deduce_unreachable (from , & unreachable );
17631763 validate_consistent_old_space (from );
17641764 untrack_tuples (from );
17651765
@@ -1853,7 +1853,7 @@ do_gc_callback(GCState *gcstate, const char *phase,
18531853 "generation" , generation ,
18541854 "collected" , stats -> collected ,
18551855 "uncollectable" , stats -> uncollectable ,
1856- "visited " , stats -> visited ,
1856+ "candidates " , stats -> candidates ,
18571857 "duration" , stats -> duration );
18581858 if (info == NULL ) {
18591859 PyErr_FormatUnraisable ("Exception ignored while invoking gc callbacks" );
0 commit comments