subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1776783 - /subversion/trunk/subversion/libsvn_client/merge.c
Date Sat, 31 Dec 2016 15:52:32 GMT
Author: julianfoad
Date: Sat Dec 31 15:52:32 2016
New Revision: 1776783

URL: http://svn.apache.org/viewvc?rev=1776783&view=rev
Log:
Tweak the subpool usage introduced in r1776742 to be less error-prone.

* subversion/libsvn_client/merge.c
  (find_last_merged_location): Use the subpool only for the mergeinfo
    catalog, and don't re-use the name 'scratch-pool' for it.

Modified:
    subversion/trunk/subversion/libsvn_client/merge.c

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1776783&r1=1776782&r2=1776783&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Sat Dec 31 15:52:32 2016
@@ -12304,9 +12304,9 @@ find_last_merged_location(svn_client__pa
   svn_revnum_t youngest_merged_rev = SVN_INVALID_REVNUM;
   svn_mergeinfo_catalog_t target_mergeinfo_cat = NULL;
 
-  /* Use a local subpool. Using this for 'target_mergeinfo_cat' in particular
-     makes a big reduction in overall memory usage. */
-  scratch_pool = svn_pool_create(scratch_pool);
+  /* Using a local subpool for 'target_mergeinfo_cat' can make a big
+     reduction in overall memory usage. */
+  apr_pool_t *tmic_pool = svn_pool_create(scratch_pool);
 
   source_peg_rev.kind = svn_opt_revision_number;
   source_peg_rev.value.number = source_branch->tip->rev;
@@ -12328,7 +12328,7 @@ find_last_merged_location(svn_client__pa
                                       operative_rev_receiver,
                                       &youngest_merged_rev,
                                       ctx, ra_session,
-                                      scratch_pool, scratch_pool));
+                                      tmic_pool, tmic_pool));
 
   if (!SVN_IS_VALID_REVNUM(youngest_merged_rev))
     {
@@ -12364,8 +12364,7 @@ find_last_merged_location(svn_client__pa
                                           operative_rev_receiver,
                                           &oldest_eligible_rev,
                                           ctx, ra_session,
-                                          scratch_pool, scratch_pool));
-      svn_pool_clear(scratch_pool);
+                                          tmic_pool, tmic_pool));
 
       /* If there are revisions eligible for merging, use the oldest one
          to calculate the base.  Otherwise there are no operative revisions
@@ -12387,7 +12386,7 @@ find_last_merged_location(svn_client__pa
                                            result_pool, scratch_pool));
     }
 
-  svn_pool_destroy(scratch_pool);
+  svn_pool_destroy(tmic_pool);
   return SVN_NO_ERROR;
 }
 



Mime
View raw message