hmm.. Re: talloc issues

Rusty Russell rusty at rustcorp.com.au
Tue Aug 4 19:18:20 MDT 2009


On Tue, 4 Aug 2009 11:37:39 pm Derrell Lipman wrote:
> On Mon, Aug 3, 2009 at 21:20, Rusty Russell <rusty at rustcorp.com.au> wrote:
> 
> > > ..and talloc is the easiest way to reference count - you don't have to
> > > change your structs for a start, and you don't have to port to C++
> > either.
> >
> > I disagree.  To repeat myself, everyone needs to know you're using
> > references,
> > even independent code, so they don't simply talloc_free() something.
> >
> 
> I've seen this statement a few times during this discussion, and I don't get
> it.

OK, it's worth spelling out then.

The problem with your analogy is that talloc_free() doesn't take a path to the
object; and it is the most convenient and common method of freeing something.
(Your analogy might be an fdunlink call).

If you only have one parent, it's clear what to do.

Hope that helps,
Rusty.


More information about the samba-technical mailing list