mirror of
https://github.com/python/cpython.git
synced 2025-10-20 00:13:47 +00:00
GH-136410: Faster side exits by using a cold exit stub (GH-136411)
This commit is contained in:
parent
718e0c89ba
commit
e7b55f564d
15 changed files with 387 additions and 267 deletions
|
@ -815,7 +815,13 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
|
|||
/* Last garbage collection on this interpreter */
|
||||
_PyGC_CollectNoFail(tstate);
|
||||
_PyGC_Fini(interp);
|
||||
|
||||
struct _PyExecutorObject *cold = interp->cold_executor;
|
||||
if (cold != NULL) {
|
||||
interp->cold_executor = NULL;
|
||||
assert(cold->vm_data.valid);
|
||||
assert(cold->vm_data.warm);
|
||||
_PyExecutor_Free(cold);
|
||||
}
|
||||
/* We don't clear sysdict and builtins until the end of this function.
|
||||
Because clearing other attributes can execute arbitrary Python code
|
||||
which requires sysdict and builtins. */
|
||||
|
@ -1469,6 +1475,7 @@ init_threadstate(_PyThreadStateImpl *_tstate,
|
|||
tstate->datastack_limit = NULL;
|
||||
tstate->what_event = -1;
|
||||
tstate->current_executor = NULL;
|
||||
tstate->jit_exit = NULL;
|
||||
tstate->dict_global_version = 0;
|
||||
|
||||
_tstate->c_stack_soft_limit = UINTPTR_MAX;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue