philip@tigris.org writes:
> Log:
> Fix part of issue 1635. Control client memory use when deleting
> lots of targets.
I might be missing something, but it looks like this commit controls
pool usage by creating a subpool at the top of a do_entry_deletion(),
then destroying it at the bottom. That is, it's not really an
iteration pool, it's a function-body pool.
Usually, we would create an iteration subpool in the caller(s), and
simply pass the subpool to do_entry_deletion(). In this case the
caller is ultimately an editor drive, but still, wouldn't the same
principle apply?
-Karl
> * subversion/libsvn_wc/update_editor.c (do_entry_deletion): Use a
> subpool.
>
>
> Modified: trunk/subversion/libsvn_wc/update_editor.c
> ==============================================================================
> --- trunk/subversion/libsvn_wc/update_editor.c (original)
> +++ trunk/subversion/libsvn_wc/update_editor.c Sat Mar 13 15:51:00 2004
> @@ -798,15 +798,16 @@
> svn_wc_adm_access_t *adm_access;
> svn_node_kind_t kind;
> const char *logfile_path;
> - const char *full_path = svn_path_join (eb->anchor, path, pool);
> - svn_stringbuf_t *log_item = svn_stringbuf_create ("", pool);
> + apr_pool_t *subpool = svn_pool_create (pool);
> + const char *full_path = svn_path_join (eb->anchor, path, subpool);
> + svn_stringbuf_t *log_item = svn_stringbuf_create ("", subpool);
>
> - SVN_ERR (svn_io_check_path (full_path, &kind, pool));
> + SVN_ERR (svn_io_check_path (full_path, &kind, subpool));
>
> SVN_ERR (svn_wc_adm_retrieve (&adm_access, eb->adm_access,
> - parent_path, pool));
> + parent_path, subpool));
>
> - logfile_path = svn_wc__adm_path (parent_path, FALSE, pool,
> + logfile_path = svn_wc__adm_path (parent_path, FALSE, subpool,
> SVN_WC__ADM_LOG, NULL);
>
> /* If trying to delete a locally-modified file, throw an 'obstructed
> @@ -815,9 +816,9 @@
> {
> svn_boolean_t tmodified_p, pmodified_p;
> SVN_ERR (svn_wc_text_modified_p (&tmodified_p, full_path, FALSE,
> - adm_access, pool));
> + adm_access, subpool));
> SVN_ERR (svn_wc_props_modified_p (&pmodified_p, full_path,
> - adm_access, pool));
> + adm_access, subpool));
>
> if (tmodified_p || pmodified_p)
> return svn_error_createf
> @@ -830,7 +831,7 @@
> parent_path,
> SVN_WC__ADM_LOG,
> (APR_WRITE | APR_CREATE), /* not excl */
> - pool));
> + subpool));
>
> /* Here's the deal: in the new editor interface, PATH is a full path
> below the editor's anchor, and parent_path is the parent directory.
> @@ -838,9 +839,9 @@
> log commands talk *only* about paths relative (and below)
> parent_path, i.e. where the log is being executed. */
>
> - base_name = svn_path_basename (path, pool);
> + base_name = svn_path_basename (path, subpool);
> svn_xml_make_open_tag (&log_item,
> - pool,
> + subpool,
> svn_xml_self_closing,
> SVN_WC__LOG_DELETE_ENTRY,
> SVN_WC__LOG_ATTR_NAME,
> @@ -852,10 +853,10 @@
> accurate reports about itself in the future. */
> if (strcmp (path, eb->target) == 0)
> {
> - tgt_rev_str = apr_psprintf (pool, "%" SVN_REVNUM_T_FMT,
> + tgt_rev_str = apr_psprintf (subpool, "%" SVN_REVNUM_T_FMT,
> *(eb->target_revision));
>
> - svn_xml_make_open_tag (&log_item, pool, svn_xml_self_closing,
> + svn_xml_make_open_tag (&log_item, subpool, svn_xml_self_closing,
> SVN_WC__LOG_MODIFY_ENTRY,
> SVN_WC__LOG_ATTR_NAME,
> path,
> @@ -873,15 +874,15 @@
> }
>
> SVN_ERR_W (svn_io_file_write_full (log_fp, log_item->data,
> - log_item->len, NULL, pool),
> - apr_psprintf (pool,
> + log_item->len, NULL, subpool),
> + apr_psprintf (subpool,
> "Error writing log file for '%s'", parent_path));
>
> SVN_ERR (svn_wc__close_adm_file (log_fp,
> parent_path,
> SVN_WC__ADM_LOG,
> TRUE, /* sync */
> - pool));
> + subpool));
>
> if (eb->switch_url)
> {
> @@ -906,7 +907,7 @@
>
> SVN_ERR (svn_wc_adm_retrieve
> (&child_access, eb->adm_access,
> - full_path, pool));
> + full_path, subpool));
>
> SVN_ERR (leftmod_error_chain
> (svn_wc_remove_from_revision_control
> @@ -916,13 +917,13 @@
> TRUE, /* instant error */
> eb->cancel_func,
> eb->cancel_baton,
> - pool),
> - logfile_path, parent_path, pool));
> + subpool),
> + logfile_path, parent_path, subpool));
> }
> }
>
> - SVN_ERR (leftmod_error_chain (svn_wc__run_log (adm_access, NULL, pool),
> - logfile_path, parent_path, pool));
> + SVN_ERR (leftmod_error_chain (svn_wc__run_log (adm_access, NULL, subpool),
> + logfile_path, parent_path, subpool));
>
> /* The passed-in `path' is relative to the anchor of the edit, so if
> * the operation was invoked on something other than ".", then
> @@ -932,7 +933,7 @@
> */
> if (eb->notify_func)
> (*eb->notify_func) (eb->notify_baton,
> - svn_path_join (parent_path, base_name, pool),
> + svn_path_join (parent_path, base_name, subpool),
> svn_wc_notify_update_delete,
> svn_node_unknown,
> NULL,
> @@ -940,6 +941,7 @@
> svn_wc_notify_state_unknown,
> SVN_INVALID_REVNUM);
>
> + svn_pool_destroy (subpool);
> return SVN_NO_ERROR;
> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 15 19:41:01 2004