lua-users home
lua-l archive

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


> I have the impression, that this int _ in the TValue struct uses only < 8
> bit of the 32 bits. So the uper 24bits (I need only the upper 16 bits) are
> out of use currently.
> 
> Is this correct, or is there any hidden usage of these 16 upper bits in
> LUA_32BITS? (In LUA_64BITS it would concern the upper 56 bits of _tt ... but
> currently please let's concentrate on LUA_32BITS ... I am currently only
> interested in this, and my main headache are date numbers with second
> resolution... I just need some bits more for them, and as they appear quite
> often I would not like to define a metatable for them ...).

A simple grep shows that the field 'tt_' is only mentioned in the
file 'lobject.h'. A careful examination of this file should give
the answer you are looking for.

For Lua 5.3, I guess those 24 bits are free. However, Lua 5.4 defines
tt_ as a lu_byte (an unsigned char), not as an int, and it explores this
smaller size to better pack key-value pairs in tables.

-- Roberto