Hi,

Thanks for the comments.

On Sun, May 22, 2016 at 3:26 AM, Gert Doering <g...@greenie.muc.de> wrote:

> thanks for digging into this.  Overall, the patch makes sense, I'm just
> wondering about this:
>
> On Sun, May 22, 2016 at 12:46:27AM -0400, Selva Nair wrote:
> > Other changes:
> > - Use minimal initial allocation size so that the realloc code path
> >   gets exercised (2 or more connections will cause realloc).
>
> I can see that this is useful for testing, but do we want this in
> production?
>
> It won't make a difference for most usages ("only one connection active"),
> but then, the extra memory use for 10 is minimal, and realloc() *can* fail,
> so just keeping at 10 won't need the realloc() path generally...
>
>

Of course, the extra memory usage is not a concern.  As a  general practice
I like malloc/realloc for growing arrays to start from the smallest
possible value to expose bugs in the logic during normal use[*].

That said, I'm ok with reverting it back to 10  or even a somewhat larger
value -- I understand the "in case the fix is buggy, be sure it doesn't
break anything" kind of feeling.

Selva

[*] See similar advice in "The Practice of Programming", section on growing
arrays..

Reply via email to