Skip to content

Commit

Permalink
GH-90699: use statically allocated interned strings in typeobject's s…
Browse files Browse the repository at this point in the history
…lotdefs (GH-94706)
  • Loading branch information
kumaraditya303 authored Sep 7, 2022
1 parent b65686c commit 4e4bfff
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 176 deletions.
3 changes: 0 additions & 3 deletions Include/internal/pycore_typeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ extern "C" {

/* runtime lifecycle */

extern PyStatus _PyTypes_InitState(PyInterpreterState *);
extern PyStatus _PyTypes_InitTypes(PyInterpreterState *);
extern void _PyTypes_FiniTypes(PyInterpreterState *);
extern void _PyTypes_Fini(PyInterpreterState *);
Expand Down Expand Up @@ -67,8 +66,6 @@ struct types_state {
};


extern PyStatus _PyTypes_InitSlotDefs(void);

extern int _PyStaticType_InitBuiltin(PyTypeObject *type);
extern static_builtin_state * _PyStaticType_GetState(PyTypeObject *);
extern void _PyStaticType_ClearWeakRefs(PyTypeObject *type);
Expand Down
18 changes: 0 additions & 18 deletions Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_symtable.h" // PySTEntry_Type
#include "pycore_typeobject.h" // _PyTypes_InitSlotDefs()
#include "pycore_unionobject.h" // _PyUnion_Type
#include "pycore_interpreteridobject.h" // _PyInterpreterID_Type

Expand Down Expand Up @@ -1835,23 +1834,6 @@ PyObject _Py_NotImplementedStruct = {
1, &_PyNotImplemented_Type
};

PyStatus
_PyTypes_InitState(PyInterpreterState *interp)
{
if (!_Py_IsMainInterpreter(interp)) {
return _PyStatus_OK();
}

PyStatus status = _PyTypes_InitSlotDefs();
if (_PyStatus_EXCEPTION(status)) {
return status;
}

return _PyStatus_OK();
}



#ifdef MS_WINDOWS
extern PyTypeObject PyHKEY_Type;
#endif
Expand Down
Loading

0 comments on commit 4e4bfff

Please sign in to comment.