Skip to content

Commit 95bb9d4

Browse files
stefanbellergitster
authored andcommitted
commit-slabs: remove realloc counter outside of slab struct
The realloc counter is declared outside the struct for the given slabname, which makes it harder for a follow up patch to move the declaration of the struct around as then the counter variable would need special treatment. As the reallocation counter is currently unused we can just remove it. If we ever need to count the reallocations again, we can reintroduce the counter as part of 'struct slabname' in commit-slab-decl.h. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fd8030c commit 95bb9d4

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

commit-slab-impl.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
#define implement_commit_slab(slabname, elemtype, scope) \
1313
\
14-
static int stat_ ##slabname## realloc; \
15-
\
1614
scope void init_ ##slabname## _with_stride(struct slabname *s, \
1715
unsigned stride) \
1816
{ \
@@ -54,7 +52,6 @@ scope elemtype *slabname## _at_peek(struct slabname *s, \
5452
if (!add_if_missing) \
5553
return NULL; \
5654
REALLOC_ARRAY(s->slab, nth_slab + 1); \
57-
stat_ ##slabname## realloc++; \
5855
for (i = s->slab_count; i <= nth_slab; i++) \
5956
s->slab[i] = NULL; \
6057
s->slab_count = nth_slab + 1; \

0 commit comments

Comments
 (0)