Skip to content

Commit 4e4bfff

Browse files
GH-90699: use statically allocated interned strings in typeobject's slotdefs (GH-94706)
1 parent b65686c commit 4e4bfff

File tree

5 files changed

+140
-176
lines changed

5 files changed

+140
-176
lines changed

Include/internal/pycore_typeobject.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ extern "C" {
1111

1212
/* runtime lifecycle */
1313

14-
extern PyStatus _PyTypes_InitState(PyInterpreterState *);
1514
extern PyStatus _PyTypes_InitTypes(PyInterpreterState *);
1615
extern void _PyTypes_FiniTypes(PyInterpreterState *);
1716
extern void _PyTypes_Fini(PyInterpreterState *);
@@ -67,8 +66,6 @@ struct types_state {
6766
};
6867

6968

70-
extern PyStatus _PyTypes_InitSlotDefs(void);
71-
7269
extern int _PyStaticType_InitBuiltin(PyTypeObject *type);
7370
extern static_builtin_state * _PyStaticType_GetState(PyTypeObject *);
7471
extern void _PyStaticType_ClearWeakRefs(PyTypeObject *type);

Objects/object.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
1515
#include "pycore_pystate.h" // _PyThreadState_GET()
1616
#include "pycore_symtable.h" // PySTEntry_Type
17-
#include "pycore_typeobject.h" // _PyTypes_InitSlotDefs()
1817
#include "pycore_unionobject.h" // _PyUnion_Type
1918
#include "pycore_interpreteridobject.h" // _PyInterpreterID_Type
2019

@@ -1835,23 +1834,6 @@ PyObject _Py_NotImplementedStruct = {
18351834
1, &_PyNotImplemented_Type
18361835
};
18371836

1838-
PyStatus
1839-
_PyTypes_InitState(PyInterpreterState *interp)
1840-
{
1841-
if (!_Py_IsMainInterpreter(interp)) {
1842-
return _PyStatus_OK();
1843-
}
1844-
1845-
PyStatus status = _PyTypes_InitSlotDefs();
1846-
if (_PyStatus_EXCEPTION(status)) {
1847-
return status;
1848-
}
1849-
1850-
return _PyStatus_OK();
1851-
}
1852-
1853-
1854-
18551837
#ifdef MS_WINDOWS
18561838
extern PyTypeObject PyHKEY_Type;
18571839
#endif

0 commit comments

Comments
 (0)