Mercurial > cpython-lru_cache-weakref
diff Include/objimpl.h @ 18933:09df3254b49d legacy-trunk
Merge of descr-branch back into trunk.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Thu, 02 Aug 2001 04:15:00 +0000 |
| parents | 3b8a5bbfd2e5 |
| children | b762220a6159 |
line wrap: on
line diff
--- a/Include/objimpl.h Wed Aug 01 21:44:14 2001 +0000 +++ b/Include/objimpl.h Thu Aug 02 04:15:00 2001 +0000 @@ -236,7 +236,13 @@ #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 @@ /* 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 */
