r2709: finally solved the talloc reference problem.
authorAndrew Tridgell <tridge@samba.org>
Tue, 28 Sep 2004 05:42:02 +0000 (05:42 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:59:24 +0000 (12:59 -0500)
commita675b09e8d45b9298df8f8c82bbaa7b91a793eb5
tree48161ba27365850055e8378339aa612360b2d9a8
parentc0af446d57224fec94f4b0901cee4532dc6835b5
r2709: finally solved the talloc reference problem.

The problem was that the simple "uint_t ref_count;" in a talloc chunk
did not give enough information. It told us that a pointer was
referenced more than once, but it didn't say who it was referenced
by. This means that when the pointer was freed we had no sane way to
clean up the reference.

I have now replaced ref_count with a "refs" list, which means that
references point to the pointer, and the pointer has a linked list of
references. So now we can cleanup from either direction without losing track of anything.

I've also added a LOCAL-TALLOC smbtorture test that tests talloc
behaviour for some common uses.
(This used to be commit 911a8d590cb184bcb892810729955c2c4cf02550)
source4/lib/talloc.c
source4/torture/config.mk
source4/torture/local/talloc.c [new file with mode: 0644]
source4/torture/torture.c