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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jun 10, 2014 at 17:38 UTC c335d74d349d201cb7627aa7233638d2953a4b02
1 file changed +7 -6
alloc.c
+7 -6
@@ -57,13 +57,14 @@ static void report(const char *name, unsigned int count, size_t size)
57 name, count, (uintmax_t) size);
58 }
59
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)
62
63 void alloc_report(void)
64 {
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);
70 }