]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-140544: use faster `_PyInterpreterState_GET` for type lock (#140584)
authorKumar Aditya <kumaraditya@python.org>
Sat, 25 Oct 2025 14:53:26 +0000 (20:23 +0530)
committerGitHub <noreply@github.com>
Sat, 25 Oct 2025 14:53:26 +0000 (14:53 +0000)
Objects/typeobject.c

index 6cc6d366a3598c467f20bad8567ee3117a0fbb5e..5841deb454da1fd6d513d5659e826b2bd1bc85bf 100644 (file)
@@ -72,7 +72,7 @@ class object "PyObject *" "&PyBaseObject_Type"
 // the type has been revealed to other threads or we only do those updates
 // while the stop-the-world mechanism is active.  The slots and flags are read
 // in many places without holding a lock and without atomics.
-#define TYPE_LOCK &PyInterpreterState_Get()->types.mutex
+#define TYPE_LOCK &_PyInterpreterState_GET()->types.mutex
 #define BEGIN_TYPE_LOCK() Py_BEGIN_CRITICAL_SECTION_MUTEX(TYPE_LOCK)
 #define END_TYPE_LOCK() Py_END_CRITICAL_SECTION()