mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
gh-94673: Hide Objects in PyTypeObject Behind Accessors (gh-104074)
This makes it much cleaner to move more PyTypeObject fields to PyInterpreterState.
This commit is contained in:
parent
fdd878650d
commit
f73abf8e03
6 changed files with 352 additions and 244 deletions
|
@ -331,10 +331,6 @@ extern int _Py_CheckSlotResult(
|
|||
const char *slot_name,
|
||||
int success);
|
||||
|
||||
// PyType_Ready() must be called if _PyType_IsReady() is false.
|
||||
// See also the Py_TPFLAGS_READY flag.
|
||||
#define _PyType_IsReady(type) ((type)->tp_dict != NULL)
|
||||
|
||||
// Test if a type supports weak references
|
||||
static inline int _PyType_SUPPORTS_WEAKREFS(PyTypeObject *type) {
|
||||
return (type->tp_weaklistoffset != 0);
|
||||
|
@ -392,8 +388,6 @@ _PyDictOrValues_SetValues(PyDictOrValues *ptr, PyDictValues *values)
|
|||
extern PyObject ** _PyObject_ComputedDictPointer(PyObject *);
|
||||
extern void _PyObject_FreeInstanceAttributes(PyObject *obj);
|
||||
extern int _PyObject_IsInstanceDictEmpty(PyObject *);
|
||||
extern int _PyType_HasSubclasses(PyTypeObject *);
|
||||
extern PyObject* _PyType_GetSubclasses(PyTypeObject *);
|
||||
|
||||
// Access macro to the members which are floating "behind" the object
|
||||
static inline PyMemberDef* _PyHeapType_GET_MEMBERS(PyHeapTypeObject *etype) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue