diff --git a/alloc.c b/alloc.c index fd2e32df8c..12afadfacd 100644 --- a/alloc.c +++ b/alloc.c @@ -82,12 +82,17 @@ void *alloc_object_node(void) static struct alloc_state commit_state; +unsigned int alloc_commit_index(void) +{ + static unsigned int count; + return count++; +} + void *alloc_commit_node(void) { - static int commit_count; struct commit *c = alloc_node(&commit_state, sizeof(struct commit)); c->object.type = OBJ_COMMIT; - c->index = commit_count++; + c->index = alloc_commit_index(); return c; } diff --git a/cache.h b/cache.h index cc46be4e0f..c708062df9 100644 --- a/cache.h +++ b/cache.h @@ -1354,6 +1354,7 @@ extern void *alloc_commit_node(void); extern void *alloc_tag_node(void); extern void *alloc_object_node(void); extern void alloc_report(void); +extern unsigned int alloc_commit_index(void); /* trace.c */ __attribute__((format (printf, 1, 2)))