-
- Downloads
gh-94673: Add Per-Interpreter Storage for Static Builtin Types (#95255)
This is the last precursor to storing tp_subclasses (and tp_weaklist) on the interpreter state for static builtin types. Here we add per-type storage on PyInterpreterState, but only for the static builtin types. This involves the following: * add PyInterpreterState.types * move PyInterpreterState.type_cache to it * add a "num_builtins_initialized" field * add a "builtins" field (a static array big enough for all the static builtin types) * add _PyStaticType_GetState() to look up a static builtin type's state * (temporarily) add PyTypeObject.tp_static_builtin_index (to hold the type's index into PyInterpreterState.types.builtins) We will be eliminating tp_static_builtin_index in a later change.
Showing
- Include/cpython/object.h 1 addition, 0 deletionsInclude/cpython/object.h
- Include/internal/pycore_interp.h 1 addition, 1 deletionInclude/internal/pycore_interp.h
- Include/internal/pycore_typeobject.h 16 additions, 0 deletionsInclude/internal/pycore_typeobject.h
- Lib/test/test_sys.py 1 addition, 1 deletionLib/test/test_sys.py
- Objects/typeobject.c 106 additions, 5 deletionsObjects/typeobject.c
Loading
Please register or sign in to comment