From 8893215aaf714154c190c66bf7d1ce568118ec39 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 18 Jul 2012 04:53:31 +0930 Subject: talloc: use a struct for pool headers. This neatens the code a bit (we should do a similar thing for all the TALLOC_CHUNK macros). Two subtler changes: (1) As a result of the struct, we actually pack object_count into the talloc header on 32-bit platforms (since the header is 40 bytes, but needs to be 16-byte aligned). (2) I avoid VALGRIND_MAKE_MEM_UNDEFINED on memmove when we resize the only entry in a pool; that's done later anyway. With -O2 on my 11.04 Ubuntu 32-bit x86 laptop, the talloc_pool speed as measured by testsuite.c actually increases 10%. Signed-off-by: Rusty Russell --- lib/talloc/testsuite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/talloc/testsuite.c') diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c index 71917038be..eaab9d7cf0 100644 --- a/lib/talloc/testsuite.c +++ b/lib/talloc/testsuite.c @@ -848,7 +848,7 @@ static bool test_speed(void) p1 = talloc_size(ctx, loop % 100); p2 = talloc_strdup(p1, "foo bar"); p3 = talloc_size(p1, 300); - talloc_free_children(ctx); + talloc_free(p1); } count += 3 * loop; } while (timeval_elapsed(&tv) < 5.0); -- cgit