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: John Cowan
Subject: Re: gawk crash with long floating-point numbers
Date: Fri, 4 Nov 2005 11:26:34 -0500
User-agent: Mutt/1.3.28i

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.

-- 
Dream projects long deferred            John Cowan <address@hidden>
usually bite the wax tadpole.            http://www.ccil.org/~cowan
        --James Lileks                  http://www.reutershealth.com




reply via email to

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