mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
bpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function (GH-30938)
Convert the PyType_SUPPORTS_WEAKREFS() macro to a regular function. It no longer access the PyTypeObject.tp_weaklistoffset member directly. Add _PyType_SUPPORTS_WEAKREFS() static inline functions, used internally by Python for best performance.
This commit is contained in:
parent
f0a648152f
commit
af32b3ef1f
7 changed files with 24 additions and 10 deletions
|
|
@ -2473,12 +2473,21 @@ type_init(PyObject *cls, PyObject *args, PyObject *kwds)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
unsigned long
|
||||
PyType_GetFlags(PyTypeObject *type)
|
||||
{
|
||||
return type->tp_flags;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
PyType_SUPPORTS_WEAKREFS(PyTypeObject *type)
|
||||
{
|
||||
return _PyType_SUPPORTS_WEAKREFS(type);
|
||||
}
|
||||
|
||||
|
||||
/* Determine the most derived metatype. */
|
||||
PyTypeObject *
|
||||
_PyType_CalculateMetaclass(PyTypeObject *metatype, PyObject *bases)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue