From ff4584caca04cb3da0dbd5b1e9bf67e40adf5312 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 13 Mar 2020 18:03:56 +0100 Subject: bpo-39947: Use _PyInterpreterState_GET_UNSAFE() (GH-18978) Replace _PyInterpreterState_Get() function call with _PyInterpreterState_GET_UNSAFE() macro which is more efficient but don't check if tstate or interp is NULL. _Py_GetConfigsAsDict() now uses _PyThreadState_GET(). --- Python/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/thread.c') diff --git a/Python/thread.c b/Python/thread.c index c36ce6ff98..ec6909c41b 100644 --- a/Python/thread.c +++ b/Python/thread.c @@ -92,7 +92,7 @@ PyThread_init_thread(void) size_t PyThread_get_stacksize(void) { - return _PyInterpreterState_Get()->pythread_stacksize; + return _PyInterpreterState_GET_UNSAFE()->pythread_stacksize; } /* Only platforms defining a THREAD_SET_STACKSIZE() macro -- cgit v1.2.1