[MPlayer-dev-eng] [PATCH] do not define MEMALIGN_HACK on mac os x

Rich Felker dalias at aerifal.cx
Wed Aug 2 19:32:54 CEST 2006


On Wed, Aug 02, 2006 at 11:48:00AM +0200, Emanuele Giaquinta wrote:
> On 7/29/06, Diego Biurrun <diego at biurrun.de> wrote:
> >On Sat, Jul 15, 2006 at 01:52:07PM -0400, Rich Felker wrote:
> >> Does the test also check for posix_memalign? This is the standard
> >> name.
> >
> >No, it doesn't.  Should it?
> 
> Yes but afaik the only system which implements it is freebsd-current
> (on glibc it is aliased to memalign iirc); note that also *BSD malloc
> should guarantee proper alignment, quoting the manpage:
> 
> "The allocated space is suitably aligned (after possible pointer
> coercion) for storage of any type of object."

This is required by the C standard. However "suitably aligned for
storage of any type of object" does not imply "suitably aligned for
use with arbitrary assembly code" unless the compiler might generate
such asm.

> So it would be better to have MEMALIGN_HACK configurable, making it
> depend on the presence of memalign is not very right.

No, it is correct. malloc is not sufficient unless the platform has a
C type with alignment requirements of 16 or more.

Rich




More information about the MPlayer-dev-eng mailing list