@@ -1289,7 +1289,6 @@ gc_collect_young(PyThreadState *tstate,
1289
1289
GCState * gcstate = & tstate -> interp -> gc ;
1290
1290
PyGC_Head * young = & gcstate -> young .head ;
1291
1291
PyGC_Head * visited = & gcstate -> old [gcstate -> visited_space ].head ;
1292
- GC_STAT_ADD (0 , collections , 1 );
1293
1292
#ifdef Py_STATS
1294
1293
{
1295
1294
Py_ssize_t count = 0 ;
@@ -1418,7 +1417,6 @@ completed_cycle(GCState *gcstate)
1418
1417
static void
1419
1418
gc_collect_increment (PyThreadState * tstate , struct gc_collection_stats * stats )
1420
1419
{
1421
- GC_STAT_ADD (1 , collections , 1 );
1422
1420
GCState * gcstate = & tstate -> interp -> gc ;
1423
1421
PyGC_Head * not_visited = & gcstate -> old [gcstate -> visited_space ^1 ].head ;
1424
1422
PyGC_Head * visited = & gcstate -> old [gcstate -> visited_space ].head ;
@@ -1464,7 +1462,6 @@ static void
1464
1462
gc_collect_full (PyThreadState * tstate ,
1465
1463
struct gc_collection_stats * stats )
1466
1464
{
1467
- GC_STAT_ADD (2 , collections , 1 );
1468
1465
GCState * gcstate = & tstate -> interp -> gc ;
1469
1466
validate_old (gcstate );
1470
1467
PyGC_Head * young = & gcstate -> young .head ;
@@ -1787,24 +1784,6 @@ PyGC_IsEnabled(void)
1787
1784
return gcstate -> enabled ;
1788
1785
}
1789
1786
1790
- // Show stats for objects in each generations
1791
- static void
1792
- show_stats_each_generations (GCState * gcstate )
1793
- {
1794
- char buf [100 ];
1795
- size_t pos = 0 ;
1796
-
1797
- for (int i = 0 ; i < NUM_GENERATIONS && pos < sizeof (buf ); i ++ ) {
1798
- pos += PyOS_snprintf (buf + pos , sizeof (buf )- pos ,
1799
- " %zd" ,
1800
- gc_list_size (GEN_HEAD (gcstate , i )));
1801
- }
1802
- PySys_FormatStderr (
1803
- "gc: objects in each generation:%s\n"
1804
- "gc: objects in permanent generation: %zd\n" ,
1805
- buf , gc_list_size (& gcstate -> permanent_generation .head ));
1806
- }
1807
-
1808
1787
Py_ssize_t
1809
1788
_PyGC_Collect (PyThreadState * tstate , int generation , _PyGC_Reason reason )
1810
1789
{
@@ -1820,10 +1799,6 @@ _PyGC_Collect(PyThreadState *tstate, int generation, _PyGC_Reason reason)
1820
1799
if (reason != _Py_GC_REASON_SHUTDOWN ) {
1821
1800
invoke_gc_callback (gcstate , "start" , generation , & stats );
1822
1801
}
1823
- if (gcstate -> debug & _PyGC_DEBUG_STATS ) {
1824
- PySys_WriteStderr ("gc: collecting generation %d...\n" , generation );
1825
- show_stats_each_generations (gcstate );
1826
- }
1827
1802
if (PyDTrace_GC_START_ENABLED ()) {
1828
1803
PyDTrace_GC_START (generation );
1829
1804
}
0 commit comments