summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a52e4ef)
raw | patch | inline | side by side (parent: a52e4ef)
author | Sergey Vlasov <vsu@altlinux.ru> | |
Tue, 15 Nov 2005 16:07:15 +0000 (19:07 +0300) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 15 Nov 2005 19:42:28 +0000 (11:42 -0800) |
The Massif tool of Valgrind revealed that parsed tree entries occupy
more than 60% of memory allocated by git-fsck-objects. These entries
can be freed immediately after use, which significantly decreases
memory consumption.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
more than 60% of memory allocated by git-fsck-objects. These entries
can be freed immediately after use, which significantly decreases
memory consumption.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
fsck-objects.c | patch | blob | history |
diff --git a/fsck-objects.c b/fsck-objects.c
index 17d05363e08b48275cb38631e82f0f48321fa728..c1b279efcbb89ec75adb22ceca3edd4341095754 100644 (file)
--- a/fsck-objects.c
+++ b/fsck-objects.c
default:
break;
}
+ free(last->name);
+ free(last);
}
last = entry;
}
+ if (last) {
+ free(last->name);
+ free(last);
+ }
+ item->entries = NULL;
retval = 0;
if (has_full_path) {