[QUICK] talloc bugs

simo idra at samba.org
Mon Jun 29 06:27:22 MDT 2009


On Mon, 2009-06-29 at 21:57 +1000, ronnie sahlberg wrote:
> A vertice that becomes completely disconnected would however be
> destroyed/freed when the last remaining edge to it is
> talloc_unreference()d

How do you create the first one ? Wouldn't it have to nuke itself as
soon as you create it because it has not relationships ?

I think all these stuff is rarely useful done at the memory allocation
layer and also your example about linked list is just about finding a
way to transform single linked list in double linked list, only
covertly.  I think it would make much more sense to have an explicit
doubly linked list if that's what you need.

In general I still don't see a strong reason to alter semantics in
talloc, and I would remind everybody that samba is not the only consumer
of this API.
Although talloc_reference() is probably seldom used anywhere, and
therefore changing the way it behaves is a possibility, please don't do
things like introducing asserts. It's better to have some memory leaking
than have any program suddenly die without any chance of recovery.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list