mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-38644: Add Py_EnterRecursiveCall() to the limited API (GH-17046)
Provide Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as regular functions for the limited API. Previously, there were defined as macros, but these macros didn't work with the limited API which cannot access PyThreadState.recursion_depth field. Remove _Py_CheckRecursionLimit from the stable ABI. Add Include/cpython/ceval.h header file.
This commit is contained in:
parent
6552563b3d
commit
f4b1e3d7c6
9 changed files with 101 additions and 38 deletions
|
@ -5632,3 +5632,21 @@ maybe_dtrace_line(PyFrameObject *frame,
|
|||
}
|
||||
*instr_prev = frame->f_lasti;
|
||||
}
|
||||
|
||||
|
||||
/* Implement Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as functions
|
||||
for the limited API. */
|
||||
|
||||
#undef Py_EnterRecursiveCall
|
||||
|
||||
int Py_EnterRecursiveCall(const char *where)
|
||||
{
|
||||
return _Py_EnterRecursiveCall_macro(where);
|
||||
}
|
||||
|
||||
#undef Py_LeaveRecursiveCall
|
||||
|
||||
void Py_LeaveRecursiveCall(void)
|
||||
{
|
||||
_Py_LeaveRecursiveCall_macro();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue