On Fri, 18 Jan 2019 at 11:37, Marc-André Lureau <marcandre.lur...@gmail.com> wrote: > The GStreamer solution is also quite readable. > https://gitlab.freedesktop.org/gstreamer/gstreamer/blob/master/gst/gstutils.h#L165
It has the disadvantage that you can never legitimately set GST_HAVE_UNALIGNED_ACCESS (because it is always undefined-behaviour by the C standard) and the slow-path versions are slow-and-clunky. Using malloc like the QEMU approach has the advantage of telling the compiler what you're doing so it can emit the optimal code on systems where it works. thanks -- PMM