hmm.. Re: talloc issues

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Jul 28 09:16:04 MDT 2009

On Tue, Jul 28, 2009 at 03:47:05PM +0100, Sam Liddicott wrote:
> I mean that when talloc_free was understood to remove the most recent
> parent, it was used liberally.
> If talloc_free means to remove only the allocating parent then it should
> almost never be used, and those that took references should release
> references.
> Many uses of talloc_free should be talloc_unreference. Talloc_free
> should only exist in functions intended to take ownership; but this is
> not the case hence the difficulty in fixing up existing code.
> My answer is to stop using talloc_free except in cases where you can
> prove it is safe, but tridge has found cases where it looked safe but
> wasn't.

Sorry, I'm lost here. If talloc_free is deprecated, I think
Samba3 needs to create its own copy of talloc, this time
without talloc_reference. This pattern (talloc/talloc_free)
has burnt itself so deeply into my mind that I am just too
old to give it up again.

I would consider myself not the dumbest programmer on earth,
but if talloc is usable only by people way smarter than I am
(Tridge, Metze and you obviously fall into that category), I
think something is deeply wrong. What used to be a simple
hierarchial allocator with destructors has become something
that my limited mind is just not able to understand. From
what I've learned over the years I've done programming is
that abstractions should be simple and code that requires
comments is inherently fishy. Talloc definitely has lost
this simplicity for its users, and for me the culprit is

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <>

More information about the samba-technical mailing list