summaryrefslogtreecommitdiff
path: root/subversion/libsvn_client/merge.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2017-08-10 21:48:34 +0000
committerPeter Wemm <peter@FreeBSD.org>2017-08-10 21:48:34 +0000
commita55fb3c0d5eca7d887798125d5b95942b1f01d4b (patch)
treeac93b49309d9d1a772298a551fc58116a1ccefad /subversion/libsvn_client/merge.c
parent608944fa5a78d7f517c9c73a7ded6c130cc97b83 (diff)
Notes
Diffstat (limited to 'subversion/libsvn_client/merge.c')
-rw-r--r--subversion/libsvn_client/merge.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/subversion/libsvn_client/merge.c b/subversion/libsvn_client/merge.c
index fed848904863..aaab4e002cf5 100644
--- a/subversion/libsvn_client/merge.c
+++ b/subversion/libsvn_client/merge.c
@@ -6465,6 +6465,7 @@ get_mergeinfo_paths(apr_array_header_t *children_with_mergeinfo,
{
int i;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+ apr_pool_t *swmi_pool;
apr_hash_t *subtrees_with_mergeinfo;
apr_hash_t *excluded_subtrees;
apr_hash_t *switched_subtrees;
@@ -6473,10 +6474,13 @@ get_mergeinfo_paths(apr_array_header_t *children_with_mergeinfo,
struct pre_merge_status_baton_t pre_merge_status_baton;
/* Case 1: Subtrees with explicit mergeinfo. */
+ /* Use a subpool for subtrees_with_mergeinfo, as it can be very large
+ and is temporary. */
+ swmi_pool = svn_pool_create(scratch_pool);
SVN_ERR(get_wc_explicit_mergeinfo_catalog(&subtrees_with_mergeinfo,
target->abspath,
depth, ctx,
- result_pool, scratch_pool));
+ swmi_pool, swmi_pool));
if (subtrees_with_mergeinfo)
{
apr_hash_index_t *hi;
@@ -6513,6 +6517,7 @@ get_mergeinfo_paths(apr_array_header_t *children_with_mergeinfo,
children_with_mergeinfo->elt_size,
compare_merge_path_t_as_paths);
}
+ svn_pool_destroy(swmi_pool);
/* Case 2: Switched subtrees
Case 10: Paths at depths of 'empty' or 'files'
@@ -12331,6 +12336,10 @@ find_last_merged_location(svn_client__pathrev_t **base_p,
svn_revnum_t youngest_merged_rev = SVN_INVALID_REVNUM;
svn_mergeinfo_catalog_t target_mergeinfo_cat = NULL;
+ /* 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;
source_start_rev.kind = svn_opt_revision_number;
@@ -12351,7 +12360,7 @@ find_last_merged_location(svn_client__pathrev_t **base_p,
operative_rev_receiver,
&youngest_merged_rev,
ctx, ra_session,
- result_pool, scratch_pool));
+ tmic_pool, tmic_pool));
if (!SVN_IS_VALID_REVNUM(youngest_merged_rev))
{
@@ -12387,7 +12396,7 @@ find_last_merged_location(svn_client__pathrev_t **base_p,
operative_rev_receiver,
&oldest_eligible_rev,
ctx, ra_session,
- scratch_pool, 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
@@ -12409,6 +12418,7 @@ find_last_merged_location(svn_client__pathrev_t **base_p,
result_pool, scratch_pool));
}
+ svn_pool_destroy(tmic_pool);
return SVN_NO_ERROR;
}