Skip to content

Commit fc17a68

Browse files
Rename _PyType_InitSlotDefsCache to _PyType_InitSlotDefsNameCounts
1 parent 75c17fb commit fc17a68

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Include/internal/pycore_typeobject.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ typedef int (*_py_validate_type)(PyTypeObject *);
149149
extern int _PyType_Validate(PyTypeObject *ty, _py_validate_type validate, unsigned int *tp_version);
150150
extern int _PyType_CacheGetItemForSpecialization(PyHeapTypeObject *ht, PyObject *descriptor, uint32_t tp_version);
151151

152-
extern int _PyType_InitSlotDefsCache(PyInterpreterState *interp);
152+
// Precalculates count of non-unique slots
153+
extern int _PyType_InitSlotDefsNameCounts(PyInterpreterState *interp);
153154

154155
#ifdef __cplusplus
155156
}

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11295,7 +11295,7 @@ update_all_slots(PyTypeObject* type)
1129511295
}
1129611296

1129711297
int
11298-
_PyType_InitSlotDefsCache(PyInterpreterState *interp)
11298+
_PyType_InitSlotDefsNameCounts(PyInterpreterState *interp)
1129911299
{
1130011300
if (interp != interp->runtime->interpreters.main) {
1130111301
return 0;

Python/pylifecycle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,8 @@ pycore_init_builtins(PyThreadState *tstate)
822822
}
823823
interp->callable_cache.object__getattribute__ = object__getattribute__;
824824

825-
if (_PyType_InitSlotDefsCache(interp) < 0) {
826-
return _PyStatus_ERR("failed to init slotdefs cache");
825+
if (_PyType_InitSlotDefsNameCounts(interp) < 0) {
826+
return _PyStatus_ERR("failed to precalculate slotdefs unique names");
827827
}
828828

829829
if (_PyBuiltins_AddExceptions(bimod) < 0) {

Python/pystate.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,6 @@ init_interpreter(PyInterpreterState *interp,
699699
_Py_stackref_associate(interp, Py_True, PyStackRef_True);
700700
#endif
701701

702-
703702
interp->_initialized = 1;
704703
return _PyStatus_OK();
705704
}

0 commit comments

Comments
 (0)