Mercurial > cpython-lru_cache-weakref
annotate Include/cellobject.h @ 25838:8540887bcec6 2.2
Backport of 2.183:
Fix memory leak in add_subclass() found by NealN with valgrind.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 18 Oct 2002 13:42:21 +0000 |
| parents | 24af842030a0 |
| children | c1eb668525e1 |
| rev | line source |
|---|---|
| 16256 | 1 /* Cell object interface */ |
| 2 | |
| 3 #ifndef Py_CELLOBJECT_H | |
| 4 #define Py_CELLOBJECT_H | |
| 5 #ifdef __cplusplus | |
| 6 extern "C" { | |
| 7 #endif | |
| 8 | |
| 9 typedef struct { | |
|
22293
24af842030a0
backport jhylton's checkin of
Michael W. Hudson <mwh@python.net>
parents:
16256
diff
changeset
|
10 PyObject_HEAD |
| 16256 | 11 PyObject *ob_ref; |
| 12 } PyCellObject; | |
| 13 | |
| 14 extern DL_IMPORT(PyTypeObject) PyCell_Type; | |
| 15 | |
| 16 #define PyCell_Check(op) ((op)->ob_type == &PyCell_Type) | |
| 17 | |
| 18 extern DL_IMPORT(PyObject *) PyCell_New(PyObject *); | |
| 19 extern DL_IMPORT(PyObject *) PyCell_Get(PyObject *); | |
| 20 extern DL_IMPORT(int) PyCell_Set(PyObject *, PyObject *); | |
| 21 | |
| 22 #define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) | |
| 23 #define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v) | |
| 24 | |
| 25 #ifdef __cplusplus | |
| 26 } | |
| 27 #endif | |
| 28 #endif /* !Py_TUPLEOBJECT_H */ |
