Re: [PATCH v3 2/8] Add delta-islands.{c,h}
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Aug 12, 2018, 04:32 UTC
- Message-ID
- <CAP8UFD34ycq-De_ZDYYZRgz6s0q0fBaAQhoYfJYxyF71=NYf9g@mail.gmail.com>
- In-Reply-To
- <20180811141251.GA17649@sigill.intra.peff.net>
On Sat, Aug 11, 2018 at 4:12 PM, Jeff King <peff@peff.net> wrote:
Show 19 quoted lines
> On Sat, Aug 11, 2018 at 12:32:32PM +0200, Christian Couder wrote:
>
>> Ok, I have made the following changes in the branch I will send next.
>>
>> diff --git a/delta-islands.c b/delta-islands.c
>> index 92137f2eca..22e4360810 100644
>> --- a/delta-islands.c
>> +++ b/delta-islands.c
>> @@ -322,8 +322,7 @@ static int island_config_callback(const char *k,
>> const char *v, void *cb)
>>
>> if (island_regexes_nr >= island_regexes_alloc) {
>> island_regexes_alloc = (island_regexes_alloc + 8) * 2;
>> - island_regexes = xrealloc(island_regexes,
>> - island_regexes_alloc * sizeof(regex_t));
>> + REALLOC_ARRAY(island_regexes, island_regexes_alloc);
>> }
>
> I think this whole block could actually be ALLOC_GROW().Yeah, thanks! The whole block will be replaced with the following in the next reroll:
ALLOC_GROW(island_regexes, island_regexes_nr + 1, island_regexes_alloc);