summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-07-01 23:44:07 (GMT)
committerGitHub <noreply@github.com>2023-07-01 23:44:07 (GMT)
commit18b1fdebe0cd5e601aa341227c13ec9d89bdf32c (patch)
tree701bc6f8ffcafff8eddc462192276a4d483f1a7b /Objects
parent0530f4f64629ff97f3feb7524da0833b9535e8b6 (diff)
downloadcpython-18b1fdebe0cd5e601aa341227c13ec9d89bdf32c.zip
cpython-18b1fdebe0cd5e601aa341227c13ec9d89bdf32c.tar.gz
cpython-18b1fdebe0cd5e601aa341227c13ec9d89bdf32c.tar.bz2
gh-106320: Remove _PyInterpreterState_Get() alias (#106321)
Replace calls to the (removed) slow _PyInterpreterState_Get() with fast inlined _PyInterpreterState_GET() function.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c4
-rw-r--r--Objects/unicodeobject.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index e67945d..3d3a63a 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -6362,7 +6362,7 @@ object___reduce_ex___impl(PyObject *self, int protocol)
/*[clinic end generated code: output=2e157766f6b50094 input=f326b43fb8a4c5ff]*/
{
#define objreduce \
- (_Py_INTERP_CACHED_OBJECT(_PyInterpreterState_Get(), objreduce))
+ (_Py_INTERP_CACHED_OBJECT(_PyInterpreterState_GET(), objreduce))
PyObject *reduce, *res;
if (objreduce == NULL) {
@@ -9688,7 +9688,7 @@ resolve_slotdups(PyTypeObject *type, PyObject *name)
/* XXX Maybe this could be optimized more -- but is it worth it? */
/* pname and ptrs act as a little cache */
- PyInterpreterState *interp = _PyInterpreterState_Get();
+ PyInterpreterState *interp = _PyInterpreterState_GET();
#define pname _Py_INTERP_CACHED_OBJECT(interp, type_slots_pname)
#define ptrs _Py_INTERP_CACHED_OBJECT(interp, type_slots_ptrs)
pytype_slotdef *p, **pp;
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 4434bf1..74def5a 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -5831,7 +5831,7 @@ _PyUnicode_DecodeUnicodeEscapeInternal(const char *s,
PyObject *errorHandler = NULL;
PyObject *exc = NULL;
_PyUnicode_Name_CAPI *ucnhash_capi;
- PyInterpreterState *interp = _PyInterpreterState_Get();
+ PyInterpreterState *interp = _PyInterpreterState_GET();
// so we can remember if we've seen an invalid escape char or not
*first_invalid_escape = NULL;