tal: simplify.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 3 Dec 2012 08:59:38 +0000 (19:29 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 3 Dec 2012 08:59:38 +0000 (19:29 +1030)
commit0f6d854ab9d85ac7e4487ff3eee464be6bb528aa
tree40cc0144bfc04a572f2dabd51fdfd4c24405f0bd
parent932d65dd6537250e617516749f03a00fea3b34f6
tal: simplify.

All the effort trying to keep the header size down to 2 pointers turns
out to be wasted.  In addition, getting the parent of a tal pointer is
now much faster.

./samba-allocs talloc.dump --tal-size:
Before:
Virtual size = 9633792, RSS = 3952640
After:
Virtual size = 9793536, RSS = 3948544

And we're much faster now, esp. on free.

./samba-allocs talloc.dump --tal:
Before:
Tal time:                2718068ns
Tal_free time:           3360258ns
Single tal_free time:    1667412ns
After:
Tal time:                2788287ns
Tal_free time:           2290167ns
Single tal_free time:    1566998ns

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'tal-fix-set-destroying-bit.patch':

tal: fix destroying bit usage.

Actually looking at a destroying contexts' parent didn't work, and a couple
of places didn't filter out the destroying bit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/tal/_info
ccan/tal/benchmark/Makefile
ccan/tal/tal.c
ccan/tal/test/run-array.c
ccan/tal/test/run-iter.c
ccan/tal/test/run-steal.c