From 832ac85ba3e58d42f4342d79062bedf01e64c687 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 29 Aug 2006 09:51:49 +0000 Subject: 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) --- source4/lib/talloc/talloc.3.xml | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'source4/lib/talloc/talloc.3.xml') diff --git a/source4/lib/talloc/talloc.3.xml b/source4/lib/talloc/talloc.3.xml index 247bb28ed9..a448e8d978 100644 --- a/source4/lib/talloc/talloc.3.xml +++ b/source4/lib/talloc/talloc.3.xml @@ -249,6 +249,11 @@ It returns 0 on success and -1 on failure. + size_t talloc_reference_count(const void *<emphasis role="italic">ptr</emphasis>); + + Return the number of references to the pointer. + + void talloc_set_name(const void *ptr, const char *fmt, ...); Each talloc pointer has a "name". The name is used principally @@ -259,6 +264,12 @@ The main use for names on pointer is for "talloc reports". See talloc_report_depth_cb(), + talloc_report_depth_file(), + talloc_report() + talloc_report() and talloc_report_full() @@ -428,6 +439,45 @@ talloc_realloc(ctx, ptr, type, 0) ==> talloc_free(ptr); has been called. + + + 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 *priv) + void *priv + + + This provides a more flexible reports than talloc_report(). It + will recursively call the callback for the entire tree of memory + referenced by the pointer. References in the tree are passed with + is_ref = 1 and the pointer that is referenced. + + + You can pass NULL for the pointer, in which case a report is + printed for the top level memory context, but only if + talloc_enable_leak_report() or talloc_enable_leak_report_full() + has been called. + + + The recursion is stopped when depth >= max_depth. + max_depth = -1 means only stop at leaf nodes. + + + + + void talloc_report_depth_file + const void *ptr + int depth + int max_depth + FILE *f + + + This provides a more flexible reports than talloc_report(). It + will let you specify the depth and max_depth. + + void talloc_enable_leak_report(void); This enables calling of talloc_report(NULL, stderr) when the -- cgit