lua-users home
lua-l archive

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


> Not exactly. In a worst case cenario, the program may be using >2^31
> bytes of memory; when it computes the threshold it will double that
> quantity. That will generate an overflow. Actually, that can happens
> even with a long, if the long is only 32 bits. The best we can do
> is the best we can do...

The paranoid programmer would presumably check for this sort of thing, and
latch the maximum threshold to ULONG_MAX (assuming you're using unsigned
long), rather than just doubling and hoping.

-- 
http://www.mupsych.org/~rrt/
Si hoc legere scis nimium eruditionis habes (Anon)