summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-11-11 00:43:56 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-11-11 00:43:56 (GMT)
commit0cae609847cccd78d3a960a70782c7b7ee891e3e (patch)
tree4a22d66df29665e7e30ed0e13055c301b68e80ea /Objects
parent7255edd3df1ff5a69700089db40fedf997788c0a (diff)
downloadcpython-0cae609847cccd78d3a960a70782c7b7ee891e3e.zip
cpython-0cae609847cccd78d3a960a70782c7b7ee891e3e.tar.gz
cpython-0cae609847cccd78d3a960a70782c7b7ee891e3e.tar.bz2
Use PyThreadState_GET() in performance critical code
It seems like _PyThreadState_UncheckedGet() is not inlined as expected, even when using gcc -O3.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/dictobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index cb67dda..290686b 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -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;