Thread (14 messages) flat view 14 messages, 3 authors, 2018-08-12

Re: [PATCH v3 2/8] Add delta-islands.{c,h}

From: Christian Couder <hidden>
Date: 2018-08-12 04:32:34

On Sat, Aug 11, 2018 at 4:12 PM, Jeff King [off-list ref] wrote:
On Sat, Aug 11, 2018 at 12:32:32PM +0200, Christian Couder wrote:
quoted
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);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help