gh-81057: Add PyInterpreterState.static_objects (gh-99397)

As we consolidate global variables, we find some objects that are almost suitable to add to _PyRuntimeState.global_objects, but have some small/sneaky bit of per-interpreter state (e.g. a weakref list). We're adding PyInterpreterState.static_objects so we can move such objects there. (We'll removed the _not_used field once we've added others.)

https://github.com/python/cpython/issues/81057
This commit is contained in:
Eric Snow 2022-11-11 14:24:18 -07:00 committed by GitHub
parent dd36b71fa6
commit f531b6879b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 5 deletions

View file

@ -1744,7 +1744,7 @@ finalize_interp_types(PyInterpreterState *interp)
_PyUnicode_Fini(interp);
_PyFloat_Fini(interp);
#ifdef Py_DEBUG
_PyStaticObjects_CheckRefcnt();
_PyStaticObjects_CheckRefcnt(interp);
#endif
}