mirror of
https://github.com/git/git.git
synced 2026-04-12 01:40:10 +02:00
use REALLOC_ARRAY for changing the allocation size of arrays
Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
3ac22f82ed
commit
2756ca4347
@@ -90,8 +90,7 @@ static MAYBE_UNUSED elemtype *slabname## _at(struct slabname *s, \
|
||||
\
|
||||
if (s->slab_count <= nth_slab) { \
|
||||
int i; \
|
||||
s->slab = xrealloc(s->slab, \
|
||||
(nth_slab + 1) * sizeof(*s->slab)); \
|
||||
REALLOC_ARRAY(s->slab, nth_slab + 1); \
|
||||
stat_ ##slabname## realloc++; \
|
||||
for (i = s->slab_count; i <= nth_slab; i++) \
|
||||
s->slab[i] = NULL; \
|
||||
|
||||
Reference in New Issue
Block a user