]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Use static inline function Py_EnterRecursiveCall() (#91988)
authorVictor Stinner <vstinner@python.org>
Wed, 4 May 2022 11:30:23 +0000 (13:30 +0200)
committerGitHub <noreply@github.com>
Wed, 4 May 2022 11:30:23 +0000 (13:30 +0200)
commitd716a0dfe2d1029111db393afaecdb04cc4093de
tree2644817d65b365bf1dd2872661948d1b564bff32
parent14243369b5f80613628a565c224bba7fb3fcacd8
Use static inline function Py_EnterRecursiveCall() (#91988)

Currently, calling Py_EnterRecursiveCall() and
Py_LeaveRecursiveCall() may use a function call or a static inline
function call, depending if the internal pycore_ceval.h header file
is included or not. Use a different name for the static inline
function to ensure that the static inline function is always used in
Python internals for best performance. Similar approach than
PyThreadState_GET() (function call) and _PyThreadState_GET() (static
inline function).

* Rename _Py_EnterRecursiveCall() to _Py_EnterRecursiveCallTstate()
* Rename _Py_LeaveRecursiveCall() to _Py_LeaveRecursiveCallTstate()
* pycore_ceval.h: Rename Py_EnterRecursiveCall() to
  _Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() and
  _Py_LeaveRecursiveCall()
15 files changed:
Include/internal/pycore_ceval.h
Modules/_ctypes/_ctypes.c
Modules/_json.c
Modules/_pickle.c
Objects/abstract.c
Objects/bytesobject.c
Objects/call.c
Objects/descrobject.c
Objects/exceptions.c
Objects/methodobject.c
Objects/object.c
Parser/asdl_c.py
Python/Python-ast.c
Python/ceval.c
Python/pythonrun.c