mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-40521: Make MemoryError free list per interpreter (GH-21086)
Each interpreter now has its own MemoryError free list: it is not longer shared by all interpreters. Add _Py_exc_state structure and PyInterpreterState.exc_state member. Move also errnomap into _Py_exc_state.
This commit is contained in:
parent
2c6e4e91c5
commit
281cce1106
5 changed files with 58 additions and 39 deletions
|
@ -602,7 +602,7 @@ pycore_init_types(PyThreadState *tstate)
|
|||
}
|
||||
}
|
||||
|
||||
status = _PyExc_Init();
|
||||
status = _PyExc_Init(tstate);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
|
@ -1249,6 +1249,7 @@ flush_std_files(void)
|
|||
static void
|
||||
finalize_interp_types(PyThreadState *tstate, int is_main_interp)
|
||||
{
|
||||
_PyExc_Fini(tstate);
|
||||
_PyFrame_Fini(tstate);
|
||||
_PyAsyncGen_Fini(tstate);
|
||||
_PyContext_Fini(tstate);
|
||||
|
@ -1289,10 +1290,6 @@ finalize_interp_clear(PyThreadState *tstate)
|
|||
|
||||
_PyWarnings_Fini(tstate->interp);
|
||||
|
||||
if (is_main_interp) {
|
||||
_PyExc_Fini();
|
||||
}
|
||||
|
||||
finalize_interp_types(tstate, is_main_interp);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue