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

Re: svn commit: rev 3598 - trunk/subversion/libsvn_fs

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2002-11-01 03:13:01 CET

On Thu, 2002-10-31 at 18:29, sussman@tigris.org wrote:
> * trail.h (struct trail_t): add new 'scratchpool' to trail.

This is undoubtedly an improvement, but passing around pool parameters
would still be better.

Right now (with the scratchpool), if you're a libsvn_fs function which
allocates a moderate amount of temporary memory, you have two choices:

  * Use a subpool of trail->scratchpool and destroy it. We like to
discourage this except for unbounded loops, because pools are considered
fairly heavyweight objects.

  * Use trail->scratchpool itself, and hope you don't get called too
many times.

If we were passing around pool parameters, you'd have the third and most
preferrable option:

  * Use the pool you were passed, and let the caller decide whether
that's a temporary subpool.

I think in general, we should never assume that a function can use a
pool stashed somewhere in a baton for temporary allocations; we should
always pass one in. (The editor interface sometimes doesn't pass in a
pool because it knows the stashed pool will only be usd once; I think
that was a mistake, just in terms of consistency, but it has no
practical problems.)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 1 03:13:47 2002

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.