Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit c335d74

Browse files
peffgitster
authored andcommitted
alloc: include any-object allocations in alloc_report
When 2c1cbec (Use proper object allocators for unknown object nodes too, 2007-04-16), added a special "any_object" allocator, it never taught alloc_report to report on it. To do so we need to add an extra type argument to the REPORT macro, as that commit did for DEFINE_ALLOCATOR. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e6dfcd6 commit c335d74

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

alloc.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ static void report(const char *name, unsigned int count, size_t size)
5757
name, count, (uintmax_t) size);
5858
}
5959

60-
#define REPORT(name) \
61-
report(#name, name##_allocs, name##_allocs * sizeof(struct name) >> 10)
60+
#define REPORT(name, type) \
61+
report(#name, name##_allocs, name##_allocs * sizeof(type) >> 10)
6262

6363
void alloc_report(void)
6464
{
65-
REPORT(blob);
66-
REPORT(tree);
67-
REPORT(commit);
68-
REPORT(tag);
65+
REPORT(blob, struct blob);
66+
REPORT(tree, struct tree);
67+
REPORT(commit, struct commit);
68+
REPORT(tag, struct tag);
69+
REPORT(object, union any_object);
6970
}

0 commit comments

Comments
 (0)