Skip to content

Commit

Permalink
commit-slabs: remove realloc counter outside of slab struct
Browse files Browse the repository at this point in the history
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 <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
stefanbeller authored and gitster committed Jun 29, 2018
1 parent fd8030c commit 95bb9d4
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions commit-slab-impl.h
Expand Up @@ -11,8 +11,6 @@

#define implement_commit_slab(slabname, elemtype, scope) \
\
static int stat_ ##slabname## realloc; \
\
scope void init_ ##slabname## _with_stride(struct slabname *s, \
unsigned stride) \
{ \
Expand Down Expand Up @@ -54,7 +52,6 @@ scope elemtype *slabname## _at_peek(struct slabname *s, \
if (!add_if_missing) \
return NULL; \
REALLOC_ARRAY(s->slab, nth_slab + 1); \
stat_ ##slabname## realloc++; \
for (i = s->slab_count; i <= nth_slab; i++) \
s->slab[i] = NULL; \
s->slab_count = nth_slab + 1; \
Expand Down

0 comments on commit 95bb9d4

Please sign in to comment.