Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use tp_basicsize
  • Loading branch information
markshannon committed Aug 20, 2024
commit a3e64643f8a6cac1790e01459bb96e9b11f4a4a1
1 change: 0 additions & 1 deletion Include/cpython/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ struct _typeobject {
/* bitset of which type-watchers care about this type */
unsigned char tp_watched;
uint16_t tp_versions_used;
uint16_t tp_inline_values_offset;
};

/* This struct is used by the specializer
Expand Down
4 changes: 2 additions & 2 deletions Include/internal/pycore_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,10 @@ static inline PyDictValues *
_PyObject_InlineValues(PyObject *obj)
{
PyTypeObject *tp = Py_TYPE(obj);
assert(tp->tp_inline_values_offset > 0 && tp->tp_inline_values_offset % sizeof(PyObject *) == 0);
assert(tp->tp_basicsize > 0 && tp->tp_basicsize % sizeof(PyObject *) == 0);
assert(Py_TYPE(obj)->tp_flags & Py_TPFLAGS_INLINE_VALUES);
assert(Py_TYPE(obj)->tp_flags & Py_TPFLAGS_MANAGED_DICT);
return (PyDictValues *)((char *)obj + tp->tp_inline_values_offset);
return (PyDictValues *)((char *)obj + tp->tp_basicsize);
}

extern PyObject ** _PyObject_ComputedDictPointer(PyObject *);
Expand Down
1 change: 0 additions & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -8341,7 +8341,6 @@ type_ready_managed_dict(PyTypeObject *type)
}
}
if (type->tp_itemsize == 0) {
type->tp_inline_values_offset = type->tp_basicsize;
type->tp_flags |= Py_TPFLAGS_INLINE_VALUES;
}
return 0;
Expand Down