From f883b692431eed7535dae55f9ba45a5d10489e03 Mon Sep 17 00:00:00 2001 From: Sergey Miryanov Date: Thu, 24 Jul 2025 00:21:49 +0500 Subject: [PATCH] Remove obsolete counting of objects in young generation - Now OBJECT_STAT_INC used to count and GC_STAT_ADD at the end of collect to adjust --- Python/gc.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Python/gc.c b/Python/gc.c index 4160f68c27a3ef..25536270523305 100644 --- a/Python/gc.c +++ b/Python/gc.c @@ -1331,15 +1331,6 @@ gc_collect_young(PyThreadState *tstate, PyGC_Head *visited = &gcstate->old[gcstate->visited_space].head; untrack_tuples(young); GC_STAT_ADD(0, collections, 1); -#ifdef Py_STATS - { - Py_ssize_t count = 0; - PyGC_Head *gc; - for (gc = GC_NEXT(young); gc != young; gc = GC_NEXT(gc)) { - count++; - } - } -#endif PyGC_Head survivors; gc_list_init(&survivors);