commit: avoid parent list buildup in clear_commit_marks_many()
clear_commit_marks_1() clears the marks of the first parent and its first parent and so on, and saves the higher numbered parents in a list for later. There is no benefit in keeping that list growing with each handled commit. Clear it after each run to reduce peak memory usage. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
2d2a71ce85
commit
1ca727f230
6
commit.c
6
commit.c
@ -780,14 +780,14 @@ static void clear_commit_marks_1(struct commit_list **plist,
|
|||||||
|
|
||||||
void clear_commit_marks_many(size_t nr, struct commit **commit, unsigned int mark)
|
void clear_commit_marks_many(size_t nr, struct commit **commit, unsigned int mark)
|
||||||
{
|
{
|
||||||
|
for (size_t i = 0; i < nr; i++) {
|
||||||
struct commit_list *list = NULL;
|
struct commit_list *list = NULL;
|
||||||
|
|
||||||
for (size_t i = 0; i < nr; i++) {
|
|
||||||
clear_commit_marks_1(&list, *commit, mark);
|
clear_commit_marks_1(&list, *commit, mark);
|
||||||
commit++;
|
|
||||||
}
|
|
||||||
while (list)
|
while (list)
|
||||||
clear_commit_marks_1(&list, pop_commit(&list), mark);
|
clear_commit_marks_1(&list, pop_commit(&list), mark);
|
||||||
|
commit++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_commit_marks(struct commit *commit, unsigned int mark)
|
void clear_commit_marks(struct commit *commit, unsigned int mark)
|
||||||
|
Reference in New Issue
Block a user