diff options
| author | Mark Shannon <mark@hotpy.org> | 2024-03-25 20:43:51 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-25 20:43:51 (GMT) |
| commit | 23e4f80ce2a2bac50acd1785e791316d5b578b8d (patch) | |
| tree | 2a0937f7b00d32a657aa745f0c1b2fe4d730a59c /Python/gc.c | |
| parent | 507896d97dcff2d7999efa264b29d9003c525c49 (diff) | |
| download | cpython-23e4f80ce2a2bac50acd1785e791316d5b578b8d.zip cpython-23e4f80ce2a2bac50acd1785e791316d5b578b8d.tar.gz cpython-23e4f80ce2a2bac50acd1785e791316d5b578b8d.tar.bz2 | |
A few minor tweaks to get stats working and compiling cleanly. (#117219)
Fixes a compilation error when configured with `--enable-pystats`,
an array size issue, and an unused variable.
Diffstat (limited to 'Python/gc.c')
| -rw-r--r-- | Python/gc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Python/gc.c b/Python/gc.c index 2517b86..6d86059 100644 --- a/Python/gc.c +++ b/Python/gc.c @@ -1285,7 +1285,6 @@ gc_collect_young(PyThreadState *tstate, for (gc = GC_NEXT(young); gc != young; gc = GC_NEXT(gc)) { count++; } - GC_STAT_ADD(0, objects_queued, count); } #endif @@ -1422,7 +1421,6 @@ gc_collect_increment(PyThreadState *tstate, struct gc_collection_stats *stats) gc_set_old_space(gc, gcstate->visited_space); increment_size += expand_region_transitively_reachable(&increment, gc, gcstate); } - GC_STAT_ADD(1, objects_queued, region_size); PyGC_Head survivors; gc_list_init(&survivors); gc_collect_region(tstate, &increment, &survivors, UNTRACK_TUPLES, stats); @@ -1805,10 +1803,10 @@ _PyGC_Collect(PyThreadState *tstate, int generation, _PyGC_Reason reason) _PyErr_SetRaisedException(tstate, exc); GC_STAT_ADD(generation, objects_collected, stats.collected); #ifdef Py_STATS - if (_py_stats) { + if (_Py_stats) { GC_STAT_ADD(generation, object_visits, - _py_stats->object_stats.object_visits); - _py_stats->object_stats.object_visits = 0; + _Py_stats->object_stats.object_visits); + _Py_stats->object_stats.object_visits = 0; } #endif validate_old(gcstate); |
