[Ffmpeg-devel] Re: [PATCH] Machine endian bytestream functions
Måns Rullgård
mans
Sat Apr 14 13:28:35 CEST 2007
matthieu castet <castet.matthieu at free.fr> writes:
> Hi,
>
> M?ns Rullg?rd wrote:
>>> + *pdata = 0x01234567;
>>> + return !(*pdata == 0x01234567);
>>> +EOF
>> This entire check is actually rather pointless. On many systems that
>> do not support unaligned accesses, the OS will by default fix it up in
>> a trap handler. There is no way to detect this, but it will run very
>> slowly. Furthermore, even on x86 aligned accesses are faster than
>> unaligned.
>>
> Is there arches where unaligned access are faster than aligned one ?
I very much doubt it, and I've certainly never seen one. Think about
why unaligned accesses are usually impossible or slow, and it should
become clear why this is unlikely.
> BTW it's nice to have all these configure checks, but they can't be
> used with cross compilation and may be give wrong result if the host
> and target aren't the same machine.
Good point.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list