From 6d6c1a35e08b95a83dbe47dbd9e6474daff00354 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Thu, 2 Aug 2001 04:15:00 +0000 Subject: Merge of descr-branch back into trunk. --- Include/objimpl.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Include/objimpl.h') diff --git a/Include/objimpl.h b/Include/objimpl.h index 4aa38d5673..18cece8e25 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -236,7 +236,13 @@ extern DL_IMPORT(void) _PyObject_Del(PyObject *); #define PyObject_GC_Fini(op) #define PyObject_AS_GC(op) (op) #define PyObject_FROM_GC(op) (op) - +#define PyType_IS_GC(t) 0 +#define PyObject_IS_GC(o) 0 +#define PyObject_AS_GC(o) (o) +#define PyObject_FROM_GC(o) (o) +#define PyType_BASICSIZE(t) ((t)->tp_basicsize) +#define PyType_SET_BASICSIZE(t, s) ((t)->tp_basicsize = (s)) + #else /* Add the object into the container set */ @@ -269,6 +275,13 @@ typedef struct _gc_head { /* Get the object given the PyGC_Head */ #define PyObject_FROM_GC(g) ((PyObject *)(((PyGC_Head *)g)+1)) +/* Calculate tp_basicsize excluding PyGC_HEAD_SIZE if applicable */ +#define PyType_BASICSIZE(t) (!PyType_IS_GC(t) ? (t)->tp_basicsize : \ + (t)->tp_basicsize - PyGC_HEAD_SIZE) +#define PyType_SET_BASICSIZE(t, s) (!PyType_IS_GC(t) ? \ + ((t)->tp_basicsize = (s)) : \ + ((t)->tp_basicsize = (s) + PyGC_HEAD_SIZE)) + extern DL_IMPORT(void) _PyGC_Dump(PyGC_Head *); #endif /* WITH_CYCLE_GC */ -- cgit v1.2.1