git-fsck-objects: Free tree entries after use
PATCH 1/1 git-fsck-objects: Free tree entries after use
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 <[email protected]>
---
fsck-objects.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
applies-to: 4b6dbe856a3e63699b299c76f4f1fc5cb34cbe26 0742a20134cc7f58f2c4cbc982a3eb115c6eaf47
fsck-objects.c +7 -0
@@ -184,10 +184,17 @@ static int fsck_tree(struct tree *item)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) {
---
0.99.9.GIT