[vlc-devel] Patches to work-around __packed__ on iOS
Rémi Denis-Courmont
remi at remlab.net
Mon Mar 26 19:10:17 CEST 2012
Le lundi 26 mars 2012 19:53:59 Felix Paul Kühne, vous avez écrit :
> Sorry, but this is the intention. Using __packed__ leads to memory
> alignment issues when running the code on ARM (especially in src/input in
> the time shift code).
Sorry but I think you didn't get the point. With that patch, the compiled
executable CODE WILL NOT WORK PROPERLY.
If packing is not needed, it should be removed. If packing is needed (and it
probably is in this case), then this patch is just wrong.
> This obviously does not happen on x86 or PPC platforms.
To the contrary, the whole point of the packing is to force unaligned
structures regardless of the target constraints. Obviously, the compiler needs
to emit memcpy() on architectures that do not support unaligned loads or
stores.
> Yes, the correct approach here would be to use a non-broken compiler.
> Regrettably, such a thing isn't available for production releases at this
> point.
I don't claim the compiler is broken and I never did. Indeed, packing is a
common but nevertheless non-standard language extension. But _broken_ code is
not an option, regardless of the bugs or limitations in the toolchain.
By the way, the correct portable solution was already discussed earlier this
month regarding OGG.
--
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
More information about the vlc-devel
mailing list