diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-11-11 00:43:56 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-11-11 00:43:56 (GMT) |
commit | 0cae609847cccd78d3a960a70782c7b7ee891e3e (patch) | |
tree | 4a22d66df29665e7e30ed0e13055c301b68e80ea /Python/errors.c | |
parent | 7255edd3df1ff5a69700089db40fedf997788c0a (diff) | |
download | cpython-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 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c index 918f4df..0c38f7c 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -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; } |