Skip to content

Commit 04318d0

Browse files
use fast access for freelist
1 parent 0ee4aba commit 04318d0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Include/internal/pycore_freelist.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@ extern "C" {
1717
static inline struct _Py_freelists *
1818
_Py_freelists_GET(void)
1919
{
20-
PyThreadState *tstate = _PyThreadState_GET();
21-
#ifdef Py_DEBUG
22-
_Py_EnsureTstateNotNULL(tstate);
23-
#endif
24-
2520
#ifdef Py_GIL_DISABLED
21+
PyThreadState *tstate = _PyThreadState_GET();
2622
return &((_PyThreadStateImpl*)tstate)->freelists;
2723
#else
28-
return &tstate->interp->object_state.freelists;
24+
PyInterpreterState *interp = _PyInterpreterState_GET();
25+
return &interp->object_state.freelists;
2926
#endif
3027
}
3128

0 commit comments

Comments
 (0)