lua-users home
lua-l archive

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


On Mon, Jan 3, 2011 at 11:34 AM, Richard Hundt <richardhundt@gmail.com> wrote:
> https://github.com/richardhundt/lua-marshal

I take it that you haven't tested it on a big-endian system?
Writing a single byte using the following code relies heavily on
integers being little endian:
> int val_type = lua_type(L, val);
> buf_write(L, (void*)&val_type, MAR_CHR, buf);
Then there is the dubious section of code starting at "/* endianness
mismatch so reverse the bytes */", which seems to reverse the entire
data stream, rather than individually reversing every field within it.
Finally, the use of lua_dump means that persisted functions cannot
cross the endianness boundary by default.