mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Use PyThreadState_GET() in performance critical code
It seems like _PyThreadState_UncheckedGet() is not inlined as expected, even when using gcc -O3.
This commit is contained in:
parent
7255edd3df
commit
0cae609847
3 changed files with 4 additions and 3 deletions
|
@ -161,7 +161,7 @@ PyErr_SetString(PyObject *exception, const char *string)
|
|||
PyObject *
|
||||
PyErr_Occurred(void)
|
||||
{
|
||||
PyThreadState *tstate = _PyThreadState_UncheckedGet();
|
||||
PyThreadState *tstate = PyThreadState_GET();
|
||||
return tstate == NULL ? NULL : tstate->curexc_type;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue