[PATCH] Add stackframes to public libsmbclient functions
Gerald (Jerry) Carter
jerry at samba.org
Mon Nov 19 15:38:43 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Derrell Lipman wrote:
> In this case, I'm not the original author of the code, so
> unless I've had reason to change it, I've just maintained
> the original organization of the code. Even with a single
> entry and exit point, though, I'd still have a hard time
> justifying "magic" inputs to the lower-layer functions.
> Without some strong reason to the contrary, I prefer the
> black-box concept with inputs and outputs well defined by
> parameters and return value.
I understand. And since I'm not the one working on libsmbclient,
it's certainly not my place to attempt to heavily influence
The talloc_stackframe() is a good idiom in my opion for
(a) removing the short lived tmp_ctx pointers that are needed
randomly throughout the code.
(b) Allowing a caller to ensure that all short lived temp
contexts are correctly cleaned up.
But then I've been bitten more than once of using the wrong
talloc_ctx and seeing huge memory blow up.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the samba-technical