summaryrefslogtreecommitdiff
path: root/source4/lib/talloc/talloc_guide.txt
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_guide.txt
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_guide.txt')
-rw-r--r--source4/lib/talloc/talloc_guide.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/source4/lib/talloc/talloc_guide.txt b/source4/lib/talloc/talloc_guide.txt
index 2c32fb1a87..83f524862f 100644
--- a/source4/lib/talloc/talloc_guide.txt
+++ b/source4/lib/talloc/talloc_guide.txt
@@ -205,6 +205,11 @@ your code.
It returns 0 on success and -1 on failure.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+size_t talloc_reference_count(const void *ptr);
+
+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 for
@@ -348,6 +353,34 @@ Passing NULL is allowed, but it will only give a meaningful result if
talloc_enable_leak_report() or talloc_enable_leak_report_full() 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_report(const void *ptr, FILE *f);