talloc: use a struct for pool headers.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 17 Jul 2012 19:23:31 +0000 (04:53 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 17 Jul 2012 19:23:31 +0000 (04:53 +0930)
commit8893215aaf714154c190c66bf7d1ce568118ec39
treeba0e573e3ba7c0da4da14569293ee806e1f90d05
parentd1a5a5bc80885270100f52ad4170987346e16ffc
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>
lib/talloc/talloc.c
lib/talloc/testsuite.c