Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Mar 17, 2020

subinterpreters: Move _PyRuntimeState.ceval.recursion_limit to
PyInterpreterState.ceval.recursion_limit: make the limit
per-interpreter.

Make _Py_FinishPendingCalls() and _PyEval_FiniThreads() functions
private.

https://bugs.python.org/issue39984

subinterpreters: Move _PyRuntimeState.ceval.recursion_limit to
PyInterpreterState.ceval.recursion_limit: make the limit
per-interpreter.

Make _Py_FinishPendingCalls() and _PyEval_FiniThreads() functions
private.
@vstinner
Copy link
Member Author

vstinner commented Mar 17, 2020

I don't understand the relationship between _Py_CheckRecursionLimit and ceval.recursion_limit.

When USE_STACKCHECK macro is not defined, _Py_CheckRecursiveCall() is called if tstate->recursion_depth is greater than _Py_CheckRecursionLimit.

If USE_STACKCHECK is defined, _Py_CheckRecursiveCall() copies ceval.recursion_limit into _Py_CheckRecursionLimit:

    /* Needed for ABI backwards-compatibility (see [bpo-31857](https://bugs.python.org/issue31857)) */
    _Py_CheckRecursionLimit = recursion_limit;

See bpo-31857.

@vstinner
Copy link
Member Author

vstinner commented Mar 17, 2020

See also bpo-38644: Add Py_EnterRecursiveCall() to the limited API (PR #17046).

@vstinner
Copy link
Member Author

This change is more complicated than expected. I started with something simpler instead, move tracing_possible: PR #19047. I close this PR.

I may rewrite this PR on top of PR #19047 once it's merged.

@vstinner vstinner closed this Mar 17, 2020
@vstinner vstinner deleted the ceval_interp branch March 17, 2020 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants