[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r40218 - trunk/subversion/svn

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Mon, 26 Oct 2009 08:32:16 +0000

Greg Stein wrote:
> On Sat, Oct 24, 2009 at 18:42, Julian Foad <julianfoad_at_btopenworld.com> wrote:
> > Greg Stein wrote:
> >> If you construct the iterpool in the declaration (as before), then you
> >> can use it for the call to svn_cl__xml_print_header(), as its
> >> scratch_pool. Any mem used by the call will be cleared on the first
> >> iteration of the loop.
[...]
> >> And if you don't destroy it so soon, then you get to use it for that
> >> last call, too.
> > [...]
> >
> > That's true, there is the opportunity to do that, but is it really worth
> > breaking the well-defined "iterpool" pattern for such a little extra
> > optimisation? I don't think so. Keep it simple.
>
> Eh? How does it break it?
>
> You alloc the iterpool. clear it at the start of each iteration.
> destroy it later. I see no change to that.

"The pool you use also helps readers of the code understand object
lifetimes. Is a given object used only during one iteration of the loop,
or will it need to last beyond the end of the loop?"

Quoted from <http://subversion.tigris.org/hacking.html#apr-pools>.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2411293
Received on 2009-10-26 09:32:51 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.