lua-users home
lua-l archive

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


> In previous Lua versions, I believe the bytecode was subject to:
> - The endianness of the machine
> - The sizeof(int) for int x; in LoadInt() in lundump.c
> - The sizeof(size_t) for size_t size = LoadByte(S); in LoadString() in lundump.c
> 
> I'm wondering, in Lua 5.3, now with tunable integer and floating point
> sizes, does this add anything to the list?

Lua 5.3 adds sizeof(lua_Integer) and sample numbers to handle endianness
and other format changes. See DumpHeader in ldump.c. The layout has
changed from 5.2 to 5.3.

> Additionally, should it reduce the list, e.g. should lundump.c be
> using lua_Integer instead of int?

We need both: int is used for the size of arrays, lua_Integer for Lua constants.