summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-12-01 00:14:27 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-12-01 01:48:25 +0100
commitb8dc3c8a83af38adf0ee5874331b04692f2dec8d (patch)
treec04ebdc3cfebc0e025911c44fc4aab67f69cfd4c
parent4f0436f107422826f93d194370b256b6d278502f (diff)
downloadsamba-b8dc3c8a83af38adf0ee5874331b04692f2dec8d.tar.gz
samba-b8dc3c8a83af38adf0ee5874331b04692f2dec8d.tar.bz2
samba-b8dc3c8a83af38adf0ee5874331b04692f2dec8d.zip
pytalloc: Make py_talloc_dealloc private.
-rw-r--r--lib/talloc/pytalloc.c11
-rw-r--r--lib/talloc/pytalloc.h3
-rw-r--r--lib/talloc/pytalloc_util.c11
3 files changed, 11 insertions, 14 deletions
diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c
index b1f2afb8d5..c45810f44d 100644
--- a/lib/talloc/pytalloc.c
+++ b/lib/talloc/pytalloc.c
@@ -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),
diff --git a/lib/talloc/pytalloc.h b/lib/talloc/pytalloc.h
index 1561576d34..affb77ce9a 100644
--- a/lib/talloc/pytalloc.h
+++ b/lib/talloc/pytalloc.h
@@ -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 *);
diff --git a/lib/talloc/pytalloc_util.c b/lib/talloc/pytalloc_util.c
index d285f01531..4ed2f16b24 100644
--- a/lib/talloc/pytalloc_util.c
+++ b/lib/talloc/pytalloc_util.c
@@ -44,17 +44,6 @@ PyTypeObject *PyTalloc_GetObjectType(void)
}
/**
- * 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.
*/
PyObject *py_talloc_steal_ex(PyTypeObject *py_type, TALLOC_CTX *mem_ctx,