type->tp_name, talloc_obj->ptr);
}
+/**
+ * Simple dealloc for talloc-wrapping PyObjects
+ */
+static void py_talloc_dealloc(PyObject* self)
+{
+ py_talloc_Object *obj = (py_talloc_Object *)self;
+ assert(talloc_unlink(NULL, obj->talloc_ctx) != -1);
+ obj->talloc_ctx = NULL;
+ self->ob_type->tp_free(self);
+}
+
static PyTypeObject TallocObject_Type = {
.tp_name = "talloc.Object",
.tp_basicsize = sizeof(py_talloc_Object),
void *ptr;
} py_talloc_Object;
-/* Deallocate a py_talloc_Object */
-void py_talloc_dealloc(PyObject* self);
-
PyTypeObject *PyTalloc_GetObjectType(void);
int PyTalloc_Check(PyObject *);
return type;
}
-/**
- * Simple dealloc for talloc-wrapping PyObjects
- */
-void py_talloc_dealloc(PyObject* self)
-{
- py_talloc_Object *obj = (py_talloc_Object *)self;
- assert(talloc_unlink(NULL, obj->talloc_ctx) != -1);
- obj->talloc_ctx = NULL;
- self->ob_type->tp_free(self);
-}
-
/**
* Import an existing talloc pointer into a Python object.
*/