[Ffmpeg-devel] random crashes decoding MP3s

Måns Rullgård mru
Mon Apr 3 15:06:58 CEST 2006


Wolfram Gloger said:
>> It is possible that some malloc() implementation always returns
>> addresses aligned to, e.g., 64 bits even on 32-bit hardware.  IIRC, glibc
>> malloc() does something like this.
>
> Yes, 8 byte alignment is necessary on _all_ 32-bit platforms that I
> know of.  Consider "double"..

Well, Intel CPUs don't strictly require any alignment at all, although they
run faster with properly aligned data.

Rephrasing again, malloc() may return addresses with stricter alignment than
is required by any native data type.  The glibc malloc() does this on at least
some architectures.  If the OpenBSD malloc() happens to return memory suitably
aligned for use with mmx/sse, even though not required by the C standard, the
memalign hack will not be needed.

-- 
M?ns Rullg?rd
mru at inprovide.com





More information about the ffmpeg-devel mailing list