summaryrefslogtreecommitdiff
path: root/diffcore-break.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-12-03 13:51:21 -0800
committerJunio C Hamano <gitster@pobox.com>2009-12-03 13:51:21 -0800
commit9a6b9cdd7240d10f9e70bfc383960b28c8f2b9a7 (patch)
treea16367b8d57dd6b5f35ef44890b5a193b60539e1 /diffcore-break.c
parentc206224b2b7a32924c40b162c59329da143aba1f (diff)
parent809809bb75e8a65ef543ab706aab4791459be95c (diff)
downloadgit-9a6b9cdd7240d10f9e70bfc383960b28c8f2b9a7.tar.gz
Merge branch 'jk/maint-break-rename-reduce-memory' into maint
* jk/maint-break-rename-reduce-memory: diffcore-rename: reduce memory footprint by freeing blob data early diffcore-break: save cnt_data for other phases diffcore-break: free filespec data as we go
Diffstat (limited to 'diffcore-break.c')
-rw-r--r--diffcore-break.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/diffcore-break.c b/diffcore-break.c
index d7097bb576..3a7b60a037 100644
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -69,7 +69,7 @@ static int should_break(struct diff_filespec *src,
return 0; /* we do not break too small filepair */
if (diffcore_count_changes(src, dst,
- NULL, NULL,
+ &src->cnt_data, &dst->cnt_data,
0,
&src_copied, &literal_added))
return 0;
@@ -204,12 +204,16 @@ void diffcore_break(int break_score)
dp->score = score;
dp->broken_pair = 1;
+ diff_free_filespec_blob(p->one);
+ diff_free_filespec_blob(p->two);
free(p); /* not diff_free_filepair(), we are
* reusing one and two here.
*/
continue;
}
}
+ diff_free_filespec_data(p->one);
+ diff_free_filespec_data(p->two);
diff_q(&outq, p);
}
free(q->queue);