svn commit: samba r4711 - in branches/SAMBA_4_0/source/lib/talloc: .

tridge at samba.org tridge at samba.org
Wed Jan 12 11:45:43 GMT 2005


Author: tridge
Date: 2005-01-12 11:45:43 +0000 (Wed, 12 Jan 2005)
New Revision: 4711

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4711

Log:
- deprecate talloc_destroy()

- expanded the talloc_realloc() test a little (I was concerned about a
  possible bug, which turned out to be an illusion)

- don't enable gcov by default in Makefile.talloc


Modified:
   branches/SAMBA_4_0/source/lib/talloc/Makefile.talloc
   branches/SAMBA_4_0/source/lib/talloc/talloc.h
   branches/SAMBA_4_0/source/lib/talloc/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/Makefile.talloc
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/Makefile.talloc	2005-01-12 11:43:18 UTC (rev 4710)
+++ branches/SAMBA_4_0/source/lib/talloc/Makefile.talloc	2005-01-12 11:45:43 UTC (rev 4711)
@@ -1,6 +1,6 @@
-OPT = -g -ftest-coverage -fprofile-arcs 
-LIBS = -lgcov
-#OPT = -g
+#OPT = -g -ftest-coverage -fprofile-arcs 
+#LIBS = -lgcov
+OPT = -O
 
 CFLAGS = $(OPT) -Wall
 

Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.h
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.h	2005-01-12 11:43:18 UTC (rev 4710)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.h	2005-01-12 11:45:43 UTC (rev 4711)
@@ -4,7 +4,7 @@
    Unix SMB/CIFS implementation.
    Samba temporary memory allocation functions
 
-   Copyright (C) Andrew Tridgell 2004
+   Copyright (C) Andrew Tridgell 2004-2005
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -54,8 +54,6 @@
 
 #define talloc_memdup(t, p, size) _talloc_memdup(t, p, size, __location__)
 
-#define talloc_destroy(ctx) talloc_free(ctx)
-
 #define malloc_p(type) (type *)malloc(sizeof(type))
 #define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count)
 #define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count)
@@ -70,6 +68,7 @@
 #define talloc_p(ctx, type) talloc(ctx, type)
 #define talloc_array_p(ctx, type, count) talloc_array(ctx, type, count)
 #define talloc_realloc_p(ctx, p, type, count) talloc_realloc(ctx, p, type, count)
+#define talloc_destroy(ctx) talloc_free(ctx)
 #endif
 
 #ifndef PRINTF_ATTRIBUTE

Modified: branches/SAMBA_4_0/source/lib/talloc/testsuite.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/testsuite.c	2005-01-12 11:43:18 UTC (rev 4710)
+++ branches/SAMBA_4_0/source/lib/talloc/testsuite.c	2005-01-12 11:45:43 UTC (rev 4711)
@@ -575,7 +575,7 @@
 		int count;
 		struct el2 {
 			const char *name;
-		} **list;
+		} **list, **list2, **list3;
 	} *el1;
 	struct el2 *el2;
 
@@ -587,11 +587,22 @@
 	el1->list = talloc(el1, struct el2 *);
 	el1->list[0] = talloc(el1->list, struct el2);
 	el1->list[0]->name = talloc_strdup(el1->list[0], "testing");
+
+	el1->list2 = talloc(el1, struct el2 *);
+	el1->list2[0] = talloc(el1->list2, struct el2);
+	el1->list2[0]->name = talloc_strdup(el1->list2[0], "testing2");
+
+	el1->list3 = talloc(el1, struct el2 *);
+	el1->list3[0] = talloc(el1->list3, struct el2);
+	el1->list3[0]->name = talloc_strdup(el1->list3[0], "testing2");
 	
 	el2 = talloc(el1->list, struct el2);
+	el2 = talloc(el1->list2, struct el2);
+	el2 = talloc(el1->list3, struct el2);
 
-	el1->list = talloc_realloc(el1, el1->list, struct el2 *, 2);
-	el1->list[1] = el2;
+	el1->list = talloc_realloc(el1, el1->list, struct el2 *, 100);
+	el1->list2 = talloc_realloc(el1, el1->list2, struct el2 *, 200);
+	el1->list3 = talloc_realloc(el1, el1->list3, struct el2 *, 300);
 
 	talloc_free(root);
 



More information about the samba-cvs mailing list