On Sat, Oct 24, 2009 at 08:35, Hyrum K. Wright <hyrum_at_hyrumwright.org> wrote:
>...
> +++ trunk/subversion/svn/proplist-cmd.c Sat Oct 24 05:35:12 2009 Â Â Â Â (r40218)
>...
>  else  /* operate on normal, versioned properties (not revprops) */
> Â Â {
> - Â Â Â apr_pool_t *subpool = svn_pool_create(pool);
> + Â Â Â apr_pool_t *iterpool;
> Â Â Â svn_proplist_receiver_t pl_receiver;
>
> Â Â Â if (opt_state->xml)
> Â Â Â Â {
> - Â Â Â Â Â SVN_ERR(svn_cl__xml_print_header("properties", pool));
> + Â Â Â Â Â SVN_ERR(svn_cl__xml_print_header("properties", scratch_pool));
> Â Â Â Â Â pl_receiver = proplist_receiver_xml;
> Â Â Â Â }
> Â Â Â else
> @@ -181,6 +180,7 @@ svn_cl__proplist(apr_getopt_t *os,
> Â Â Â if (opt_state->depth == svn_depth_unknown)
> Â Â Â Â opt_state->depth = svn_depth_empty;
>
> + Â Â Â iterpool = svn_pool_create(scratch_pool);
> Â Â Â for (i = 0; i < targets->nelts; i++)
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.
>...
> @@ -204,17 +204,16 @@ svn_cl__proplist(apr_getopt_t *os,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â opt_state->depth,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â opt_state->changelists,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â pl_receiver, &pl_baton,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ctx, subpool),
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ctx, iterpool),
> Â Â Â Â Â Â Â Â Â Â NULL, opt_state->quiet,
> Â Â Â Â Â Â Â Â Â Â SVN_ERR_UNVERSIONED_RESOURCE,
> Â Â Â Â Â Â Â Â Â Â SVN_ERR_ENTRY_NOT_FOUND,
> Â Â Â Â Â Â Â Â Â Â SVN_NO_ERROR));
> Â Â Â Â }
> + Â Â Â svn_pool_destroy(iterpool);
>
> Â Â Â if (opt_state->xml)
> - Â Â Â Â SVN_ERR(svn_cl__xml_print_footer("properties", pool));
> -
> - Â Â Â svn_pool_destroy(subpool);
> + Â Â Â Â SVN_ERR(svn_cl__xml_print_footer("properties", scratch_pool));
> Â Â }
>
> Â return SVN_NO_ERROR;
And if you don't destroy it so soon, then you get to use it for that
last call, too.
>...
> +++ trunk/subversion/svn/resolve-cmd.c  Sat Oct 24 05:35:12 2009     (r40218)
>...
> @@ -52,7 +52,7 @@ svn_cl__resolve(apr_getopt_t *os,
> Â svn_error_t *err;
> Â apr_array_header_t *targets;
> Â int i;
> - Â apr_pool_t *subpool;
> + Â apr_pool_t *iterpool;
There is a similar opportunity in this function.
>...
> +++ trunk/subversion/svn/resolved-cmd.c Sat Oct 24 05:35:12 2009 Â Â Â Â (r40218)
> @@ -44,48 +44,48 @@
> Â svn_error_t *
> Â svn_cl__resolved(apr_getopt_t *os,
> Â Â Â Â Â Â Â Â Â void *baton,
> - Â Â Â Â Â Â Â Â apr_pool_t *pool)
> + Â Â Â Â Â Â Â Â apr_pool_t *scratch_pool)
> Â {
> Â svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
> Â svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
> Â svn_error_t *err;
> Â apr_array_header_t *targets;
> + Â apr_pool_t *iterpool;
> Â int i;
> - Â apr_pool_t *subpool;
>
> Â SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â opt_state->targets,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ctx, pool));
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ctx, scratch_pool));
And obviously in this function, too.
>...
> +++ trunk/subversion/svn/status-cmd.c  Sat Oct 24 05:35:12 2009     (r40218)
> @@ -170,23 +170,23 @@ print_status(void *baton,
> Â svn_error_t *
> Â svn_cl__status(apr_getopt_t *os,
> Â Â Â Â Â Â Â Â void *baton,
> - Â Â Â Â Â Â Â apr_pool_t *pool)
> + Â Â Â Â Â Â Â apr_pool_t *scratch_pool)
> Â {
> Â svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
> Â svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
> Â apr_array_header_t *targets;
> - Â apr_pool_t *subpool;
> - Â apr_hash_t *master_cl_hash = apr_hash_make(pool);
> + Â apr_pool_t *iterpool;
> + Â apr_hash_t *master_cl_hash = apr_hash_make(scratch_pool);
> Â int i;
> Â svn_opt_revision_t rev;
> Â struct status_baton sb;
>
> Â SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â opt_state->targets,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ctx, pool));
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ctx, scratch_pool));
And here, too!
>...
> @@ -267,9 +266,9 @@ svn_cl__status(apr_getopt_t *os,
> Â Â Â svn_stringbuf_t *buf;
>
> Â Â Â if (opt_state->xml)
> - Â Â Â Â buf = svn_stringbuf_create("", pool);
> + Â Â Â Â buf = svn_stringbuf_create("", scratch_pool);
>
> - Â Â Â for (hi = apr_hash_first(pool, master_cl_hash); hi;
> + Â Â Â for (hi = apr_hash_first(scratch_pool, master_cl_hash); hi;
> Â Â Â Â Â Â hi = apr_hash_next(hi))
> Â Â Â Â {
Seems that this function should be using the iterpool?
Tho some of the XML output may need to remain in scratch_pool or
something, but there are a couple cases to use iterpool.
>...
> + Â svn_pool_destroy(iterpool);
>
> - Â svn_pool_destroy(subpool);
> Â if (opt_state->xml && (! opt_state->incremental))
> - Â Â SVN_ERR(svn_cl__xml_print_footer("status", pool));
> + Â Â SVN_ERR(svn_cl__xml_print_footer("status", scratch_pool));
>
> Â return SVN_NO_ERROR;
> Â }
And to not destroy it so soon.
>...
> +++ trunk/subversion/svn/upgrade-cmd.c  Sat Oct 24 05:35:12 2009     (r40218)
> @@ -42,37 +42,37 @@
> Â svn_error_t *
> Â svn_cl__upgrade(apr_getopt_t *os,
> Â Â Â Â Â Â Â Â void *baton,
> - Â Â Â Â Â Â Â Â apr_pool_t *pool)
> + Â Â Â Â Â Â Â Â apr_pool_t *scratch_pool)
> Â {
> Â svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
> Â svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
> Â apr_array_header_t *targets;
> - Â apr_pool_t *subpool;
> + Â apr_pool_t *iterpool;
> Â int i;
>
> Â SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â opt_state->targets,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ctx, pool));
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ctx, scratch_pool));
And here!
>...
Cheers,
-g
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2411052
Received on 2009-10-24 17:42:37 CEST