diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-07-18 04:53:31 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-07-18 04:53:31 +0930 |
commit | 8893215aaf714154c190c66bf7d1ce568118ec39 (patch) | |
tree | ba0e573e3ba7c0da4da14569293ee806e1f90d05 /lib/talloc/testsuite.c | |
parent | d1a5a5bc80885270100f52ad4170987346e16ffc (diff) | |
download | samba-8893215aaf714154c190c66bf7d1ce568118ec39.tar.gz samba-8893215aaf714154c190c66bf7d1ce568118ec39.tar.bz2 samba-8893215aaf714154c190c66bf7d1ce568118ec39.zip |
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 <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/talloc/testsuite.c')
-rw-r--r-- | lib/talloc/testsuite.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |