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

Re: [PATCH] Fix fsfs finalization memory usage

From: <kfogel_at_collab.net>
Date: 2004-11-01 19:21:49 CET

Eric Gillespie <epg@pretzelnet.org> writes:
> > You could move the initial read_change() call right up against the
> > 'while' loop, and add a comment to indicate that that first call is
> > really the start of the loop -- the initialization stage of the loop,
> > in a sense.
>
> Look at the bit i re-quoted above. change is the loop condition,
> so moving read_change to the top and losing the one outside the
> loop doesn't work.

No, you'd just have to have an

   if (! change)
     break;

at the top of the loop. (I assumed this to be part of the standard
transformation from 'while' to 'do-while', sorry for not being more
explicit.)

> > But I think a better option would be to switch to a 'do-while' loop,
> > and put the single read_change() call at the start of the loop.
>
> I'd have to go for this nastiness:
>
> do
> {
> SVN_ERR (read_change (&change, file, iterpool));
> if (!change)
> break;
> ...

Heh. I hadn't even read this part yet when I wrote the above :-).

> I think it's best the way it is.

Then do at least add a comment explaining why using iterpool in that
inital call to read_change() is not an abuse of iterpool's meaning.
That would help clarify why the general pattern here is not like our
usual loop-pool pattern.

Thanks,
-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 1 21:15:40 2004

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