[QUICK] talloc bugs

Sam Liddicott sam at liddicott.com
Wed Jul 1 13:28:19 GMT 2009


* Rusty Russell wrote, On 01/07/09 13:32:
> On Wed, 1 Jul 2009 09:24:01 pm Volker Lendecke wrote:
>   
>> On Wed, Jul 01, 2009 at 09:20:13PM +0930, Rusty Russell wrote:
>>     
>>> This is a classic case of problematic references, too.  Ignoring the fact
>>> that TDB should handle multiple opens, there's nothing obviously wrong
>>> with:
>>>       
>> I'm afraid things are a bit busy for me here. But as I said:
>> This is on my list to remove the call to talloc_reference.
>> I am really sorry if this code now causes major hickups in
>> this discussion.
>>     
>
> Naah, it's still a good simple example, both of reference abuse and as a 
> starting point for "if we invented our ideal API, what would it look like?".
>   
Rusty;

I went through this process for talloc and ended up very close to our
current codebase.

the API would look like it does now, we would just change the public
meaning of "parent", and partition the api into the older backwards
compatible malloc/free/steal with the tc->parent becoming the
convenience pointer, and the new ref/unref (as Simo calls them) for new
code.

Both of these API halves will play together nicely; and be API/ABI
compatible with what we have now.

Sam


More information about the samba-technical mailing list