|
Does this make |
|
Hm, this is a bit confusing. There are three different values: ceval.recursion_limit - Used by Py_GetRecursionLimit Then there's this comment: I think the idea was for check_recursion_limit to be the replacement for _Py_CheckRecursionLimit, as a mutable counter field for USE_STACKCHECK, with recursion_limit being constant. So technically, this change makes both _Py_CheckRecursionLimit and check_recursion_limit obsolete. But if we really want to maintain it as part of the "ABI", then we need to keep it around. I doubt the existing code is actually ABI stable though, since the existing macro was:
Which assumes the offset of "overflowed" in the PyThreadState structure is part of the ABI, which it is explicitly not. ( http://legacy.python.org/dev/peps/pep-0384/#structures ) But if we want to keep it compatible, I could add the assignment:
in _Py_CheckRecursiveCall. This would preserve the old behavior when the old macro is in use. |
|
My preference would be to remove _Py_CheckRecursionLimit and check_recursion_limit, but if you think ABI compatibility for this feature is important, I could remove check_recursion_limit and make the behavior of _Py_CheckRecursionLimit backwards-compatible. |
|
Yeah, to actually provide a stable ABI, |
Add a counter in the thread state object to trigger USE_STACKCHECK invocations every 64 times Py_EnterRecursiveCall is called in a thread.
https://bugs.python.org/issue31857