-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
Description
Feature or enhancement
Proposal:
There is no template and label for refactoring yet.
I have found a dead code in gc.c for young generation.
Lines 1334 to 1342 in ec7fad7
#ifdef Py_STATS | |
{ | |
Py_ssize_t count = 0; | |
PyGC_Head *gc; | |
for (gc = GC_NEXT(young); gc != young; gc = GC_NEXT(gc)) { | |
count++; | |
} | |
} | |
#endif |
It is superseded by counting of object_visits
via OBJECT_STAT_INC
and adjusted gc_stats[gen].object_visits
at the end of the collection.
Lines 2073 to 2079 in ec7fad7
#ifdef Py_STATS | |
if (_Py_stats) { | |
GC_STAT_ADD(generation, object_visits, | |
_Py_stats->object_stats.object_visits); | |
_Py_stats->object_stats.object_visits = 0; | |
} | |
#endif |
I believe it is worth to remove dead code to decrease code base (yeah, by 9 lines).
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)