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

Re: binary data file and endianness and multiarch



> The mesh files are stored in binary form, and thus endian-ness
> is a worry when moving from one platform to another.
[...]
> What is not clear to me right now is how to [store] those data files:
> is there an endian triplet ?

Jérôme,

Please try to work with upstream to fix the issue.  Byte swapping is
essentially free on modern processors (on Intel/AMD, the time for a bswap
instruction is hidden by the latency of the memory access), so there's no
reason whatsoever not to have arch-independent data files.

Standardising on big-endian is a good idea, not only because it is the
canonical byte ordering, but also because little-endian arches tend to
have more efficient byte-swapping instructions.

Please do try.  It might seem easier to do your own distribution-specific
workaround, but working with upstream will be more productive (and enjoyable)
in the long term.

-- Juliusz


Reply to: