new talloc interface in Samba4

Henrik Nordstrom hno at
Tue Sep 28 16:22:43 GMT 2004

On Wed, 29 Sep 2004 tridge at wrote:

> Internally I ideally wanted each pointer to truly have N parents as
> well as M children, but properly managing a n-ary tree with that
> property was beyond the capabilities of my simple brain. I got a
> headache just thinking about what talloc_steal() would do in that
> situation :)

I would put it this way:

talloc implements hierarchical memory management with N parents M 
childrens property of each node. Internally optimizes the hierarchy 
management by declaring one of the parents "the parent" and the others 
references which allows for a very efficient reference and tmalloc_free 
implementation. Due to user demand this "the parent" property is also 
exposed in the interface and can be hinted to tmalloc to further optimize 
management of the allocated memory.

Note: If you have a true N parents property there is no talloc_steal 
operation as you can not steal something you already have.


More information about the samba-technical mailing list