pytalloc: Make py_talloc_dealloc private.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 30 Nov 2010 23:14:27 +0000 (00:14 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 1 Dec 2010 00:48:25 +0000 (01:48 +0100)
lib/talloc/pytalloc.c
lib/talloc/pytalloc.h
lib/talloc/pytalloc_util.c

index b1f2afb8d5666fe81ddb7529f87c04e5c1fb669d..c45810f44dfccade17958a9de6bc952d2be4e0bb 100644 (file)
@@ -86,6 +86,17 @@ static PyObject *py_talloc_default_repr(PyObject *obj)
                                   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),
index 1561576d34e079644107d666a7458e7b3419572b..affb77ce9a0ee1d891c1b5ee55ba8989f8cef901 100644 (file)
@@ -29,9 +29,6 @@ typedef struct {
        void *ptr;
 } py_talloc_Object;
 
-/* Deallocate a py_talloc_Object */
-void py_talloc_dealloc(PyObject* self);
-
 PyTypeObject *PyTalloc_GetObjectType(void);
 int PyTalloc_Check(PyObject *);
 
index d285f0153106d7d71a81a349cd4d30e8712e7497..4ed2f16b2487b1f2afec5a313d2635a2d6f762dd 100644 (file)
@@ -43,17 +43,6 @@ PyTypeObject *PyTalloc_GetObjectType(void)
        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.
  */