You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2011/07/21 14:13:07 UTC

svn commit: r1149141 - /subversion/trunk/subversion/libsvn_client/merge.c

Author: philip
Date: Thu Jul 21 12:13:06 2011
New Revision: 1149141

URL: http://svn.apache.org/viewvc?rev=1149141&view=rev
Log:
Followup to r1149105, we no longer need to use the log_noop_baton_t
pool as a iterpool.

* subversion/libsvn_client/merge.c:
  (struct log_noop_baton_t): Tweak comment.
  (log_noop_revs): Don't dup rangelists or clear baton pool, allocate
   temporary rangelist from scratch_pool.

Suggested by: stsp

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=1149141&r1=1149140&r2=1149141&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Thu Jul 21 12:13:06 2011
@@ -7872,11 +7872,7 @@ typedef struct log_noop_baton_t
   apr_array_header_t *operative_ranges;
   apr_array_header_t *merged_ranges;
 
-  /* Pool to store the rangelists. It stores the final result, as well
-   * as temporary copies of rangelists which get created while we compute
-   * the result across multiple invocations of log_noop_revs().
-   * This pool needs to be cleared periodically to prevent unbound
-   * growth of allocations. */
+  /* Pool to store the rangelists. */
   apr_pool_t *pool;
 } log_noop_baton_t;
 
@@ -7932,21 +7928,6 @@ log_noop_revs(void *baton,
   apr_hash_index_t *hi;
   svn_revnum_t revision;
   svn_boolean_t log_entry_rev_required = FALSE;
-  apr_array_header_t *rl1;
-  apr_array_header_t *rl2;
-
-  /* The baton's pool is essentially an iterpool so we must clear it
-   * for each invocation of this function, preserving the result
-   * we computed during the previous invocation but discarding any
-   * data allocated before the previous invocation. (Note that
-   * svn_rangelist_merge() returns a newly allocated rangelist.) */
-  rl1 = svn_rangelist_dup(log_gap_baton->operative_ranges, scratch_pool);
-  rl2 = svn_rangelist_dup(log_gap_baton->merged_ranges, scratch_pool);
-  svn_pool_clear(log_gap_baton->pool);
-  log_gap_baton->operative_ranges = svn_rangelist_dup(rl1,
-                                                      log_gap_baton->pool);
-  log_gap_baton->merged_ranges = svn_rangelist_dup(rl2,
-                                                   log_gap_baton->pool);
 
   revision = log_entry->revision;
 
@@ -8019,7 +8000,7 @@ log_noop_revs(void *baton,
           apr_array_header_t *rangelist;
 
           rangelist = svn_rangelist__initialize(revision - 1, revision, TRUE,
-                                                log_gap_baton->pool);
+                                                scratch_pool);
 
           /* If PATH inherited mergeinfo we must consider inheritance in the
              event the inherited mergeinfo is actually non-inheritable. */