[PATCH] Use talloc_autofree_context() to allocate global memory

Kamen Mazdrashki kamenim at samba.org
Sun Oct 5 14:59:38 MDT 2014


On Sun, Oct 5, 2014 at 10:09 PM, Andrew Bartlett <abartlet at samba.org> wrote:

> On Wed, 2014-10-01 at 02:56 +0200, Kamen Mazdrashki wrote:
> > Hi team,
> >
> > I have rebased the patches on top of latest master.
> > *
> >
> http://git.samba.org/?p=kamenim/samba.git;a=shortlog;h=refs/heads/util-debug-use-autofree-context
> > * https://github.com/kamenim/samba/pull/1 - for github lovers published
> as
> > pull request
> >
> > Any reviews (or reviewd-by) are appreciated :)
>
> G'Day Kamen,
>
> I've pushed the loadparm patches.  I have this nagging doubt about using
> talloc_autofree_context(), but I can't give a rational explanation.
>
> Fair enough :)
You have much more experience with this code, so your gut feeling is perhaps
more relevant in this case than a rational explanation.

Btw, what about this patch:
https://github.com/kamenim/samba/commit/5154ad8af73735147341a3d2c4d3a40ef2ce399a
it just introduces a temporary TALLOC_CTX - basically scoping where
allocations take place
(+ fairly vague optimization which I have put saucy comment for at
https://github.com/kamenim/samba/commit/5154ad8af73735147341a3d2c4d3a40ef2ce399a#diff-e2f740724734e0c0de5779fb42a46e78R227
)

I will try to propose something else for autofree_context when I get back
to it.
>From unit tests, those patches works fine - unit tests also run in
multiprocess fashion.
But it is just a unit test that are not designed to run 24/7. I will look
even more careful for
side effects into those areas next time I am there.

Cheers,
Kamen


> Sorry,
>
> Andrew Bartlett
>
>
>
> --
> Andrew Bartlett
> http://samba.org/~abartlet/
> Authentication Developer, Samba Team  http://samba.org
> Samba Developer, Catalyst IT
> http://catalyst.net.nz/services/samba
>
>
>
>
>


More information about the samba-technical mailing list