summaryrefslogtreecommitdiff
path: root/source4/lib/talloc/talloc.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-08-29 09:51:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:54 -0500
commit832ac85ba3e58d42f4342d79062bedf01e64c687 (patch)
tree0c730c345a66b79661202eacd2cc8e307872c4fc /source4/lib/talloc/talloc.h
parent3caba856238d985c31c5e3509336060b3d8fcc86 (diff)
downloadsamba-832ac85ba3e58d42f4342d79062bedf01e64c687.tar.gz
samba-832ac85ba3e58d42f4342d79062bedf01e64c687.tar.bz2
samba-832ac85ba3e58d42f4342d79062bedf01e64c687.zip
r17907: - add a generic talloc_report_depth_cb() function which takes a callback
to do the actual report. - make the talloc_report_depth_file() a wrapper of it - and talloc_report() and talloc_report_full() are wrapper of talloc_report_depth_file() metze (This used to be commit b199557b358e6216d89d233513079fcd56b307aa)
Diffstat (limited to 'source4/lib/talloc/talloc.h')
-rw-r--r--source4/lib/talloc/talloc.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/source4/lib/talloc/talloc.h b/source4/lib/talloc/talloc.h
index 9d6edd88ba..fdc0fd3494 100644
--- a/source4/lib/talloc/talloc.h
+++ b/source4/lib/talloc/talloc.h
@@ -5,6 +5,7 @@
Samba temporary memory allocation functions
Copyright (C) Andrew Tridgell 2004-2005
+ Copyright (C) Stefan Metzmacher 2006
** NOTE! The following LGPL license applies to the talloc
** library. This does NOT imply that all of Samba is released
@@ -110,6 +111,7 @@ typedef void TALLOC_CTX;
void *_talloc(const void *context, size_t size);
void _talloc_set_destructor(const void *ptr, int (*destructor)(void *));
int talloc_increase_ref_count(const void *ptr);
+size_t talloc_reference_count(const void *ptr);
void *_talloc_reference(const void *context, const void *ptr);
int talloc_unlink(const void *context, void *ptr);
const char *talloc_set_name(const void *ptr, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
@@ -119,7 +121,6 @@ void *talloc_named(const void *context, size_t size,
void *talloc_named_const(const void *context, size_t size, const char *name);
const char *talloc_get_name(const void *ptr);
void *talloc_check_name(const void *ptr, const char *name);
-void talloc_report_depth(const void *ptr, FILE *f, int depth);
void *talloc_parent(const void *ptr);
void *talloc_init(const char *fmt, ...) PRINTF_ATTRIBUTE(1,2);
int talloc_free(void *ptr);
@@ -128,6 +129,13 @@ void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *n
void *_talloc_steal(const void *new_ctx, const void *ptr);
size_t talloc_total_size(const void *ptr);
size_t talloc_total_blocks(const void *ptr);
+void talloc_report_depth_cb(const void *ptr, int depth, int max_depth,
+ void (*callback)(const void *ptr,
+ int depth, int max_depth,
+ int is_ref,
+ void *private_data),
+ void *private_data);
+void talloc_report_depth_file(const void *ptr, int depth, int max_depth, FILE *f);
void talloc_report_full(const void *ptr, FILE *f);
void talloc_report(const void *ptr, FILE *f);
void talloc_enable_null_tracking(void);
@@ -142,8 +150,7 @@ char *talloc_append_string(const void *t, char *orig, const char *append);
char *talloc_vasprintf(const void *t, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0);
char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0);
char *talloc_asprintf(const void *t, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
-char *talloc_asprintf_append(char *s,
- const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
+char *talloc_asprintf_append(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
void *_talloc_array(const void *ctx, size_t el_size, unsigned count, const char *name);
void *_talloc_zero_array(const void *ctx, size_t el_size, unsigned count, const char *name);
void *_talloc_realloc_array(const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name);