svn commit: samba r23290 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_26/source/nsswitch

Jeremy Allison jra at samba.org
Fri Jun 1 23:07:46 GMT 2007


On Sat, Jun 02, 2007 at 01:01:39AM +0200, Michael Adam wrote:
> 
> Correct. What is the benefit of using mem_ctx?
> 
> Volker told me a couple of days ago that the using the
> array as parent context for talloc'ing entries is the
> most natural thing.
> 
> Maybe using mem_ctx, when the heirarchy is not needed,
> is more obvious that it the argument is treated as a talloc 
> context? (in this case I _know_ I have talloced the array,
> so i can safely use it as a talloc contecxt). What else? 
> Is it better (with respect to the administrative efforts) 
> to keep the hierarchy flat?
> 
> Any enlightenment appreciated!

I'm not sure there's any enlightenment here :-).

Personally I think it's just a style thing. 

I am wary of the "any pointer is a talloc
pointer" idiom as it's easy to screw up
when you have a mixture of malloc and
talloc pointers. So I tend to explicitly
use the top-level context to remind me.

But that might be because my coding style
sucks :-), but I find it easier to remember
by doing that.

Jeremy.


More information about the samba-technical mailing list