bpo-42745: Make the type cache per-interpreter (GH-23947)

Make the type attribute lookup cache per-interpreter.

Add private _PyType_InitCache() function, called by PyInterpreterState_New().

Continue to share next_version_tag between interpreters, since static
types are still shared by interpreters.

Remove MCACHE macro: the cache is no longer disabled if the
EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined.
This commit is contained in:
Victor Stinner 2020-12-26 01:45:43 +01:00 committed by GitHub
parent 77fde8dc16
commit 4101018488
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 136 additions and 90 deletions

View file

@ -1750,7 +1750,7 @@ Py_FinalizeEx(void)
_PyImport_Fini();
/* Cleanup typeobject.c's internal caches. */
_PyType_Fini();
_PyType_Fini(tstate);
/* unload faulthandler module */
_PyFaulthandler_Fini();