alloc: add repository argument to alloc_report

This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. Use a macro to catch callers passing a repository other than the_repository at compile time. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed May 8, 2018 at 12:37 UTC 17bfe87369a726ebf3b1156ffd38c014bbd67e88
2 files changed +3 -2
alloc.c
+1 -1
@@ -105,7 +105,7 @@ static void report(const char *name, unsigned int count, size_t size)
105 #define REPORT(name, type) \
106 report(#name, name##_state.count, name##_state.count * sizeof(type) >> 10)
107
108 -void alloc_report(void)
108 +void alloc_report_the_repository(void)
109 {
110 REPORT(blob, struct blob);
111 REPORT(tree, struct tree);
cache.h
+2 -1
@@ -1774,7 +1774,8 @@ extern void *alloc_commit_node_the_repository(void);
1774 extern void *alloc_tag_node_the_repository(void);
1775 #define alloc_object_node(r) alloc_object_node_##r()
1776 extern void *alloc_object_node_the_repository(void);
1777 -extern void alloc_report(void);
1777 +#define alloc_report(r) alloc_report_##r()
1778 +extern void alloc_report_the_repository(void);
1779 extern unsigned int alloc_commit_index(void);
1780
1781 /* pkt-line.c */