The tracking statistics were actually too pessimistic
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 5069c76..931b1fc 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -498,6 +498,7 @@
_PyObject_GC_MAY_BE_TRACKED(ep[i].me_key))
return;
}
+ DECREASE_TRACK_COUNT
_PyObject_GC_UNTRACK(op);
}
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 644d8a9..0a9c718 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -50,9 +50,6 @@
{
register PyTupleObject *op;
Py_ssize_t i;
-#ifdef SHOW_TRACK_COUNT
- count_tracked++;
-#endif
if (size < 0) {
PyErr_BadInternalCall();
return NULL;
@@ -104,6 +101,9 @@
Py_INCREF(op); /* extra INCREF so that this is never freed */
}
#endif
+#ifdef SHOW_TRACK_COUNT
+ count_tracked++;
+#endif
_PyObject_GC_TRACK(op);
return (PyObject *) op;
}