mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-45753: Make recursion checks more efficient. (GH-29524)
* Uses recursion remaining, instead of recursion depth to speed up check against recursion limit.
This commit is contained in:
parent
9bf2cbc4c4
commit
b931077375
10 changed files with 50 additions and 43 deletions
|
@ -636,9 +636,9 @@ new_threadstate(PyInterpreterState *interp, int init)
|
|||
|
||||
tstate->interp = interp;
|
||||
|
||||
tstate->recursion_depth = 0;
|
||||
tstate->recursion_limit = interp->ceval.recursion_limit;
|
||||
tstate->recursion_remaining = interp->ceval.recursion_limit;
|
||||
tstate->recursion_headroom = 0;
|
||||
tstate->stackcheck_counter = 0;
|
||||
tstate->tracing = 0;
|
||||
tstate->root_cframe.use_tracing = 0;
|
||||
tstate->root_cframe.current_frame = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue