talloc -- Eureka*

Sam Liddicott sam at liddicott.com
Thu Jul 30 06:52:33 MDT 2009


* Rusty Russell wrote, On 30/07/09 03:04:
> On Wed, 29 Jul 2009 04:22:31 pm Sam Liddicott wrote:
>> While we don't want people to eagerly:
>>  s/talloc_slippy_reference/talloc_safe_reference/
>> neither do we want people writing fresh new code to chose the old
>> function, the one with unpredictable side effects (which will now be
>> talloc_free failing on multiple "old" references).
> 
> How about: talloc_attach/detach or talloc_connect/disconnect?
> 
> A completely new namespace is far clearer, esp. if we're going to deprecate
> the old ones.

This is true; I take the view that the current talloc audience is
miniscule compared to what it will be; and so for the new users the old
namespace is new and can sensibly be applied to the new behaviour.

As we only want to preserve the old behaviour for as long as samba needs
it (which may be forever) and (I think) we don't want new code to use
the old reference functions or for the old functions to look legitimate
I hope the old functions  will have self-deprecating names. |Then when
(if) they vanish, it can be quietly.

Maybe the old functions should be talloc_add_parent? I'm not eager to
fight over this though.

I think talloc_reference_sticky will do, and the suffix "sticky" helps
to attract attention to the differences so that users will hopefully
pick the right one to use. (sadly the suffix will also draw attention to
the whole unfortunate saga which would be better left to fade away).

Sam


More information about the samba-technical mailing list