lua-users home
lua-l archive

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


Fabio,

thx for the insight. So, if the endianness of the byte code dump is stored within the dump does that mean that I can take the bytecode that was "compiled" from text on a little endian machine, save it to disk, then load it on a machine that is big endian and run the dump and lua will properly notice the endianness mismatch and byte swap as necessary?

Or can you simply not take byte code from one endian machine onto an opposite endian machine?

thx,
ando


They have the endianess of the machine where you're dumping them.
luaU_dump stores a byte that indicates the machine's endianess along
with the bytecodes, so luaU_undump can adjust, if the endianess of the
machine where you are reading the bytecodes is different. Check
ldump.c and lundump.c if you are curious.

--
Fabio

On Mon, 1 Nov 2004 10:30:40 -0800, Ando Sonenblick <ando@spritec.com> wrote:
gang,

Does lua's byte code have an endianness?  Or is it really all in 8-bit
bytes?

Thx,
ando

Ando Sonenblick
    SpriTec Software
       ando@spritec.com