diff options
author | Victor Stinner <vstinner@python.org> | 2023-07-01 23:44:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-01 23:44:07 (GMT) |
commit | 18b1fdebe0cd5e601aa341227c13ec9d89bdf32c (patch) | |
tree | 701bc6f8ffcafff8eddc462192276a4d483f1a7b /Include | |
parent | 0530f4f64629ff97f3feb7524da0833b9535e8b6 (diff) | |
download | cpython-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 'Include')
-rw-r--r-- | Include/cpython/pystate.h | 5 | ||||
-rw-r--r-- | Include/internal/pycore_pystate.h | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index f33c72d..7d9e41b 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -261,9 +261,6 @@ struct _ts { /* other API */ -// Alias for backward compatibility with Python 3.8 -#define _PyInterpreterState_Get PyInterpreterState_Get - /* An alias for the internal _PyThreadState_New(), kept for stable ABI compatibility. */ PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *); @@ -295,7 +292,7 @@ PyAPI_FUNC(int) PyGILState_Check(void); This function doesn't check for error. Return NULL before _PyGILState_Init() is called and after _PyGILState_Fini() is called. - See also _PyInterpreterState_Get() and _PyInterpreterState_GET(). */ + See also PyInterpreterState_Get() and _PyInterpreterState_GET(). */ PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void); /* The implementation of sys._current_frames() Returns a dict mapping diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index 43652c4..63fc6b2 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -108,7 +108,7 @@ _Py_EnsureFuncTstateNotNULL(const char *func, PyThreadState *tstate) The caller must hold the GIL. - See also _PyInterpreterState_Get() + See also PyInterpreterState_Get() and _PyGILState_GetInterpreterStateUnsafe(). */ static inline PyInterpreterState* _PyInterpreterState_GET(void) { PyThreadState *tstate = _PyThreadState_GET(); |