]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-38644: Pass tstate to Py_EnterRecursiveCall() (GH-16997)
authorVictor Stinner <vstinner@python.org>
Mon, 4 Nov 2019 23:51:22 +0000 (00:51 +0100)
committerGitHub <noreply@github.com>
Mon, 4 Nov 2019 23:51:22 +0000 (00:51 +0100)
commitbe434dc0380d9f5c7c800de9943cc46d55fd9491
treebbf95dcf9ccc433e071cb4ce09984b5c5128f67e
parentf4b1e3d7c64985f5d5b00f6cc9a1c146bbbfd613
bpo-38644: Pass tstate to Py_EnterRecursiveCall() (GH-16997)

* Add _Py_EnterRecursiveCall() and _Py_LeaveRecursiveCall() which
  require a tstate argument.
* Pass tstate to _Py_MakeRecCheck() and  _Py_CheckRecursiveCall().
* Convert Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() macros
  to static inline functions.

_PyThreadState_GET() is the most efficient way to get the tstate, and
so using it with _Py_EnterRecursiveCall() and
_Py_LeaveRecursiveCall() should be a little bit more efficient than
using Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() which use
the "slower" PyThreadState_GET().
Include/cpython/ceval.h
Objects/abstract.c
Objects/call.c
Objects/descrobject.c
Objects/methodobject.c
Objects/object.c
Python/ceval.c