svn commit: samba r2743 - in branches/SAMBA_4_0: .
tridge at samba.org
tridge at samba.org
Tue Sep 28 23:31:52 GMT 2004
Author: tridge
Date: 2004-09-28 23:31:52 +0000 (Tue, 28 Sep 2004)
New Revision: 2743
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0&rev=2743&nolog=1
Log:
fixed some errors in the description of talloc_reference(). Volker
told me he found the description confusing, and given that some of it
was not correct I am not surprised!
added some more docs on the reporting calls
Modified:
branches/SAMBA_4_0/talloc_guide.txt
Changeset:
Modified: branches/SAMBA_4_0/talloc_guide.txt
===================================================================
--- branches/SAMBA_4_0/talloc_guide.txt 2004-09-28 23:30:14 UTC (rev 2742)
+++ branches/SAMBA_4_0/talloc_guide.txt 2004-09-28 23:31:52 UTC (rev 2743)
@@ -104,9 +104,8 @@
If this pointer has an additional reference when talloc_free() is
called then the memory is not actually released, but instead the
-reference is destroyed and the memory becomes a child of the
-referrer. See talloc_reference() for details on establishing
-additional references.
+reference is destroyed. See talloc_reference() for details on
+establishing additional references.
talloc_free() operates recursively on its children.
@@ -129,7 +128,8 @@
destroy the reference and make the pointer a child of "context".
- you can talloc_free() the pointer itself. That will destroy the
- reference and make the pointer a child of "context".
+ most recently established reference to the pointer and leave the
+ pointer as a child of its current parent.
- you can talloc_free() the context where you placed the
reference. That will destroy the reference, and leave the pointer
@@ -284,8 +284,24 @@
The talloc_total_size() function returns the total size in bytes used
by this pointer and all child pointers. Mostly useful for debugging.
+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.
+
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+off_t talloc_total_blocks(const void *ptr);
+
+The talloc_total_blocks() function returns the total memory block
+count used by this pointer and all child pointers. Mostly useful for
+debugging.
+
+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(const void *ptr, FILE *f);
The talloc_report() function prints a summary report of all memory
@@ -293,7 +309,9 @@
ptr, showing the total memory and number of blocks used by that child.
You can pass NULL for the pointer, in which case a report is printed
-for the top level memory context.
+for the top level memory context, but only if
+talloc_enable_leak_report() or talloc_enable_leak_report_full() has
+been called.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@@ -305,7 +323,9 @@
pointer that is referenced.
You can pass NULL for the pointer, in which case a report is printed
-for the top level memory context.
+for the top level memory context, but only if
+talloc_enable_leak_report() or talloc_enable_leak_report_full() has
+been called.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@@ -315,7 +335,13 @@
exits. In Samba4 this is enabled by using the --leak-report command
line option.
+For it to be useful, this function must be called before any other
+talloc function as it establishes a "null context" that acts as the
+top of the tree. If you don't call this function first then passing
+NULL to talloc_report() or talloc_report_full() won't give you the
+full tree printout.
+
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
void talloc_enable_leak_report_full(void);
@@ -323,7 +349,13 @@
program exits. In Samba4 this is enabled by using the
--leak-report-full command line option.
+For it to be useful, this function must be called before any other
+talloc function as it establishes a "null context" that acts as the
+top of the tree. If you don't call this function first then passing
+NULL to talloc_report() or talloc_report_full() won't give you the
+full tree printout.
+
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
void *talloc_zero(const void *ctx, size_t size);
More information about the samba-cvs
mailing list