bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk crash with long floating-point numbers


From: Andrew J. Schorr
Subject: Re: gawk crash with long floating-point numbers
Date: Fri, 4 Nov 2005 12:18:30 -0500
User-agent: Mutt/1.4.1i

On Fri, Nov 04, 2005 at 11:26:34AM -0500, John Cowan wrote:
> Andrew J. Schorr scripsit:
> 
> > But how do we know that doubling the size of the
> > buffer will increase the size sufficiently?  Shouldn't it
> > be something like this?
> 
> We don't know it will, and you're right that the current doubling-only
> code is buggy.  But doubling is in general desirable, because it means
> that each buffer element needs to be copied only once on average.
> There's a good clear explanation at 
> http://www.cs.rice.edu/~cork/book/node86.html
> of this.
> 
> So what's needed, given that we don't want to loop, is to either use double
> the current size or the current size + delta, whichever is greater.

The patch I sent increases the buffer size by AT LEAST a factor of 2
each time.  Why does that not meet your performance criteria?

Regards,
Andy




reply via email to

[Prev in Thread] Current Thread [Next in Thread]