On Friday 02 February 2007 00:52, Jim Meyering wrote:

> The length of the string being searched matters.  More precisely,
> it's the offsets (into the buffer being searched) of the beginning
> and end of the match.

I see.

> I've just changed xalloc's x2nrealloc to do n = 3n/2, rather than n *= 2,
> and with that change, the above invocation of "nl" completed:

For allocating memory that big it would be far better to just use mmap()
with the full range and let the kernel serve you freshly zeroed memory 
on demand as you touch it.

If there are a lot of such allocations there might be an issue with 
the available virtual space on 32bit hosts, but on anything 64bit
it should work fine.

-Andi


Reply via email to