diff options
Diffstat (limited to 'alloc.c')
-rw-r--r-- | alloc.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -47,10 +47,18 @@ union any_object { DEFINE_ALLOCATOR(blob, struct blob) DEFINE_ALLOCATOR(tree, struct tree) -DEFINE_ALLOCATOR(commit, struct commit) +DEFINE_ALLOCATOR(raw_commit, struct commit) DEFINE_ALLOCATOR(tag, struct tag) DEFINE_ALLOCATOR(object, union any_object) +void *alloc_commit_node(void) +{ + static int commit_count; + struct commit *c = alloc_raw_commit_node(); + c->index = commit_count++; + return c; +} + static void report(const char *name, unsigned int count, size_t size) { fprintf(stderr, "%10s: %8u (%"PRIuMAX" kB)\n", @@ -64,7 +72,7 @@ void alloc_report(void) { REPORT(blob, struct blob); REPORT(tree, struct tree); - REPORT(commit, struct commit); + REPORT(raw_commit, struct commit); REPORT(tag, struct tag); REPORT(object, union any_object); } |