Skip to content

Commit 698e5f5

Browse files
committed
Address review comments
1 parent 1c2030a commit 698e5f5

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Include/internal/pycore_gc.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ static inline void _PyObject_GC_TRACK(
244244
"object is in generation which is garbage collected",
245245
filename, lineno, __func__);
246246

247-
PyThreadState *tstate = _PyThreadState_GET();
248-
struct _gc_runtime_state *gcstate = &tstate->interp->gc;
247+
struct _gc_runtime_state *gcstate = &_PyInterpreterState_GET()->gc;
249248
PyGC_Head *generation0 = &gcstate->young.head;
250249
PyGC_Head *last = (PyGC_Head*)(generation0->_gc_prev);
251250
_PyGCHead_SET_NEXT(last, gc);

Misc/NEWS.d/next/Core_and_Builtins/2025-10-17-18-03-12.gh-issue-139951.IdwM2O.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ Fixes a regression in GC performance for a growing heap composed mostly of
22
small tuples.
33

44
* Counts number of actually tracked objects, instead of trackable objects.
5-
This ensures that untracking tuples has the desired effect of reducing GC overhead
5+
This ensures that untracking tuples has the desired effect of reducing GC overhead.
66
* Does not track most untrackable tuples during creation.
77
This prevents large numbers of small tuples causing excessive GCs.

0 commit comments

Comments
 (0)