[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-897-g72dc717

Michael Adam ma at sernet.de
Wed Dec 26 18:40:52 GMT 2007

Volker Lendecke wrote:
> On Wed, Dec 26, 2007 at 12:26:48PM +0000, idra at samba.org wrote:
> > I thought that talloc_stackframe() was to be used in functions that were
> > difficult to convert to use talloc contexts. Why this removal of
> > existing and working context passing ??
> Well, here I have to agree with Michael. From an API point
> of view there's no point to pass a temporary talloc context
> to libnet_smbconf_set_global_param(), I think we should only
> pass talloc contexts when there's something that will be
> returned.

That was exactly my understanding and my reason for removing
the parameter!

For me, talloc_stackframe() just adds more safety to temporary
talloc contexts: When something is not free-d in a function, the
data is at least not completely leaked, but only to the parent
stackframe. And it also frees data that has been added by called
functions to talloc_tos() or child stackframes.
It is thus just a safer replacement for talloc_new()
or talloc_init(). 
And like in the example referred to, it may hide such temporary
contexts from callers. 


Michael Adam <ma at sernet.de>
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.SerNet.DE, mailto: Info @ SerNet.DE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 206 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20071226/9f32d6f6/attachment.bin

More information about the samba-technical mailing list