lua-users home
lua-l archive

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


> A 32 bit int might be too small?

In a modern 64 bit machine, it is not unreasonable to imagine a Lua
program using more than 2^31 (or 2^32) bytes of memory. So, an `int' is
not enough for byte counters like `GCthreshold' or `nblocks'.


> Would you only need >32 bit ints on a >32 bit platform?

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...

-- Roberto