lua-users home
lua-l archive

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


> My question is, is the current thinking that the
> array part must be only as big as the the underlying int type may address?

This has been the "current thinking" in Lua for a long time.


> Has it been considered to allow greater ranges for the array part?

Yes. They cannot be larger than size_t, which are equal to unsigned int
in most 32-bit machines. size_t, for its part, can be larger, equal, or
smaller than lua_Integer. We could switch to unsigned int, but we still 
assume that 'long long' may not exist, which means that the platform may
have no type larger than unsigned int. Things get too messy.
And, of course, using larger numbers may have a performance impact
(mostly in the rehashing algorithm, but also in the size of a Table node
and in some other parts) that everybody will pay, even those not needing
arrays larger than 34GB. (Maybe expanding it to 'unsigned int' could be
done with little impact, if there is a demand for that.)

-- Roberto