Skip to content

[WIP] bpo-39984: Add PyInterpreterState.ceval #19034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

[WIP] bpo-39984: Add PyInterpreterState.ceval #19034

wants to merge 1 commit into from

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