subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1776780 - /subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c
Date Sat, 31 Dec 2016 15:49:29 GMT
Author: stefan2
Date: Sat Dec 31 15:49:29 2016
New Revision: 1776780

URL: http://svn.apache.org/viewvc?rev=1776780&view=rev
Log:
Reduce the memory usage of the svn-mergeinfo-normalizer tool
by tightening pool usage.

* tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c
  (parse_mergeinfo): Actually use the ITERPOOL that we have.
  (svn_min__read_mergeinfo): Add another pool for temporary data
                             and clean temp pools asap.

Modified:
    subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c

Modified: subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c?rev=1776780&r1=1776779&r2=1776780&view=diff
==============================================================================
--- subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c (original)
+++ subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c Sat Dec 31
15:49:29 2016
@@ -88,7 +88,7 @@ parse_mergeinfo(apr_array_header_t **res
       svn_string_t *mi_string = apr_hash_this_val(hi);
 
       svn_pool_clear(iterpool);
-      SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mi_string->data, scratch_pool));
+      SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mi_string->data, iterpool));
 
       entry->local_path = apr_pstrdup(result_pool, apr_hash_this_key(hi));
       entry->mergeinfo = svn_mergeinfo_dup(mergeinfo, result_pool);
@@ -200,7 +200,10 @@ svn_min__read_mergeinfo(apr_array_header
   svn_min__opt_state_t *opt_state = baton->opt_state;
   svn_client_ctx_t *ctx = baton->ctx;
 
+  /* Pools for temporary data - to be cleaned up asap as they
+   * significant amounts of it. */
   apr_pool_t *props_pool = svn_pool_create(scratch_pool);
+  apr_pool_t *props_scratch_pool = svn_pool_create(scratch_pool);
   apr_hash_t *props;
 
   const svn_opt_revision_t rev_working = { svn_opt_revision_working };
@@ -214,12 +217,14 @@ svn_min__read_mergeinfo(apr_array_header
                               baton->local_abspath, &rev_working,
                               &rev_working, NULL,
                               opt_state->depth, NULL, ctx,
-                              props_pool, scratch_pool));
-  SVN_ERR(parse_mergeinfo(result, props, result_pool, scratch_pool));
-  SVN_ERR(link_parents(*result, baton, scratch_pool));
+                              props_pool, props_scratch_pool));
+  svn_pool_destroy(props_scratch_pool);
 
+  SVN_ERR(parse_mergeinfo(result, props, result_pool, scratch_pool));
   svn_pool_destroy(props_pool);
 
+  SVN_ERR(link_parents(*result, baton, scratch_pool));
+
   if (!baton->opt_state->quiet)
     SVN_ERR(svn_min__print_mergeinfo_stats(*result, scratch_pool));
 



Mime
View raw message