alloc: add repository argument to alloc_report
authorStefan Beller <sbeller@google.com>
Tue, 8 May 2018 19:37:32 +0000 (12:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 May 2018 03:12:36 +0000 (12:12 +0900)
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>
alloc.c
cache.h
diff --git a/alloc.c b/alloc.c
index f031ce422d95d08818afd38590a3c46064fbadac..28b85b221441b9802736f375638fff469b3c01b1 100644 (file)
--- a/alloc.c
+++ b/alloc.c
@@ -105,7 +105,7 @@ static void report(const char *name, unsigned int count, size_t size)
 #define REPORT(name, type)     \
     report(#name, name##_state.count, name##_state.count * sizeof(type) >> 10)
 
-void alloc_report(void)
+void alloc_report_the_repository(void)
 {
        REPORT(blob, struct blob);
        REPORT(tree, struct tree);
diff --git a/cache.h b/cache.h
index 2d60359a96412bf6bd94e1ac8eea44081d4c88ac..01cc207d218f6cf9c99fadbe585746d2a8b88a1e 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1774,7 +1774,8 @@ extern void *alloc_commit_node_the_repository(void);
 extern void *alloc_tag_node_the_repository(void);
 #define alloc_object_node(r) alloc_object_node_##r()
 extern void *alloc_object_node_the_repository(void);
-extern void alloc_report(void);
+#define alloc_report(r) alloc_report_##r()
+extern void alloc_report_the_repository(void);
 extern unsigned int alloc_commit_index(void);
 
 /* pkt-line.c */