From 18ea973c21ee4a6adc26be41027881043fa498eb Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 28 Jan 2022 00:39:52 +0100 Subject: bpo-40170: Remove PyHeapType_GET_MEMBERS() macro (GH-30942) Remove the PyHeapType_GET_MEMBERS() macro. It was exposed in the public C API by mistake, it must only be used by Python internally. Use the PyTypeObject.tp_members member instead. Rename PyHeapType_GET_MEMBERS() to _PyHeapType_GET_MEMBERS() and move it to the internal C API. --- Include/internal/pycore_object.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Include/internal/pycore_object.h') diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 5fe4ddb2ef..e2da2537c1 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -232,6 +232,10 @@ extern void _PyObject_FreeInstanceAttributes(PyObject *self); extern int _PyObject_IsInstanceDictEmpty(PyObject *); extern PyObject* _PyType_GetSubclasses(PyTypeObject *); +// Access macro to the members which are floating "behind" the object +#define _PyHeapType_GET_MEMBERS(etype) \ + ((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize)) + #ifdef __cplusplus } #endif -- cgit v1.2.1