diff options
author | Victor Stinner <vstinner@python.org> | 2020-06-23 20:55:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 20:55:46 (GMT) |
commit | 281cce1106568ef9fec17e3c72d289416fac02a5 (patch) | |
tree | 529d24e0db048c8914cc8a12ebf7b8328a62665d /Python/pylifecycle.c | |
parent | 2c6e4e91c5a4d3f25908108f4ed32aba936df70c (diff) | |
download | cpython-281cce1106568ef9fec17e3c72d289416fac02a5.zip cpython-281cce1106568ef9fec17e3c72d289416fac02a5.tar.gz cpython-281cce1106568ef9fec17e3c72d289416fac02a5.tar.bz2 |
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.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 09945a8..f0b40b3 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -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); } |