[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 6296 - in trunk/subversion: clients/cmdline include libsvn_client libsvn_wc

From: Greg Stein <gstein_at_lyra.org>
Date: 2003-06-20 00:05:23 CEST

On Thu, Jun 19, 2003 at 02:06:32AM -0500, cmpilato@tigris.org wrote:
>...
> +++ trunk/subversion/libsvn_wc/entries.c Thu Jun 19 02:06:20 2003
>...
> /* Loop over each of the other entries. */
> - for (hi = apr_hash_first (subpool, entries); hi; hi = apr_hash_next (hi))
> + for (hi = apr_hash_first (pool, entries); hi; hi = apr_hash_next (hi))
> {
> const void *key;
> apr_ssize_t klen;
> @@ -1688,7 +1688,7 @@
>
> entrypath = svn_path_join (dirpath, key, subpool);
> SVN_ERR (walk_callbacks->found_entry (entrypath, current_entry,
> - walk_baton));
> + walk_baton, subpool));
>
> if (current_entry->kind == svn_node_dir)
> {
> @@ -1699,6 +1699,8 @@
> walk_callbacks, walk_baton,
> show_deleted, subpool));
> }
> +
> + svn_pool_clear (subpool);

The "standard" pattern is to put this at the start of the loop. It is
slightly more optimal, but (primarily) if the loop contains a "continue",
then the pool will still be cleared if it gets invoked.

This pool *does* have a continue, but it makes no allocations prior to that
point (so no biggy right now). But if it grew something in the future...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 20 00:02:23 2003

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.