You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/07/20 20:34:44 UTC
svn commit: r1148882 - /subversion/trunk/subversion/libsvn_client/merge.c
Author: stsp
Date: Wed Jul 20 18:34:43 2011
New Revision: 1148882
URL: http://svn.apache.org/viewvc?rev=1148882&view=rev
Log:
* subversion/libsvn_client/merge.c
(log_noop_baton_t, log_noop_revs): Add comments explaining the
unusual rules governing the pool member of log_noop_baton_t.
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=1148882&r1=1148881&r2=1148882&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Wed Jul 20 18:34:43 2011
@@ -7860,10 +7860,16 @@ typedef struct log_noop_baton_t
being diffed. */
const char *source_repos_abs;
- /* Initially empty rangelists allocated in POOL. */
+ /* Initially empty rangelists allocated in POOL. The rangelists are
+ * populated across multiple invocations of the log_noop_revs(). */
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. */
apr_pool_t *pool;
} log_noop_baton_t;
@@ -7894,7 +7900,10 @@ log_noop_revs(void *baton,
apr_array_header_t *rangelist;
/* The baton's pool is essentially an iterpool so we must clear it
- * for each invocation of this function. */
+ * 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);