mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -1409,7 +1409,7 @@ PyDict_GetItem(PyObject *op, PyObject *key)
|
|||
Let's just hope that no exception occurs then... This must be
|
||||
_PyThreadState_Current and not PyThreadState_GET() because in debug
|
||||
mode, the latter complains if tstate is NULL. */
|
||||
tstate = _PyThreadState_UncheckedGet();
|
||||
tstate = PyThreadState_GET();
|
||||
if (tstate != NULL && tstate->curexc_type != NULL) {
|
||||
/* preserve the existing exception */
|
||||
PyObject *err_type, *err_value, *err_tb;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue