svn commit: samba r17893 - in branches/SAMBA_4_0/source/lib/talloc:
.
metze at samba.org
metze at samba.org
Mon Aug 28 17:50:27 GMT 2006
Author: metze
Date: 2006-08-28 17:50:26 +0000 (Mon, 28 Aug 2006)
New Revision: 17893
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17893
Log:
add a function to disable the null_context
metze
Modified:
branches/SAMBA_4_0/source/lib/talloc/talloc.c
branches/SAMBA_4_0/source/lib/talloc/talloc.h
branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt
Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c 2006-08-28 17:40:31 UTC (rev 17892)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c 2006-08-28 17:50:26 UTC (rev 17893)
@@ -79,10 +79,9 @@
talloc_enable_leak_report_full() is called, otherwise it remains
NULL
*/
-static const void *null_context;
+static void *null_context;
static void *cleanup_context;
-
struct talloc_reference_handle {
struct talloc_reference_handle *next, *prev;
void *ptr;
@@ -909,6 +908,15 @@
}
/*
+ disable tracking of the NULL context
+*/
+void talloc_disable_null_tracking(void)
+{
+ talloc_free(null_context);
+ null_context = NULL;
+}
+
+/*
enable leak reporting on exit
*/
void talloc_enable_leak_report(void)
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.h
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.h 2006-08-28 17:40:31 UTC (rev 17892)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.h 2006-08-28 17:50:26 UTC (rev 17893)
@@ -129,6 +129,7 @@
void talloc_report_full(const void *ptr, FILE *f);
void talloc_report(const void *ptr, FILE *f);
void talloc_enable_null_tracking(void);
+void talloc_disable_null_tracking(void);
void talloc_enable_leak_report(void);
void talloc_enable_leak_report_full(void);
void *_talloc_zero(const void *ctx, size_t size, const char *name);
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt 2006-08-28 17:40:31 UTC (rev 17892)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt 2006-08-28 17:50:26 UTC (rev 17893)
@@ -432,7 +432,11 @@
reporting on exit. Useful for when you want to do your own leak
reporting call via talloc_report_null_full();
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+void talloc_disable_null_tracking(void);
+This disables tracking of the NULL memory context.
+
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
(type *)talloc_zero(const void *ctx, type);
More information about the samba-cvs
mailing list