memalign
mkstemp
pld
+ posix_memalign
ppc64
round
roundf
check_func inet_aton $network_extralibs
check_func memalign
check_func mkstemp
+check_func posix_memalign
check_func_headers windows.h GetProcessTimes
check_header conio.h
check_header vdpau/vdpau_x11.h
check_header X11/extensions/XvMClib.h
-if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
- die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
+if ! enabled_any memalign memalign_hack posix_memalign && enabled need_memalign ; then
+ die "Error, no aligned memory allocator but SSE enabled, disable it or use --enable-memalign-hack."
fi
disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
#undef free
#undef realloc
+#include <stdlib.h>
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
void *av_malloc(unsigned int size)
{
- void *ptr;
+ void *ptr = NULL;
#ifdef CONFIG_MEMALIGN_HACK
long diff;
#endif
diff= ((-(long)ptr - 1)&15) + 1;
ptr = (char*)ptr + diff;
((char*)ptr)[-1]= diff;
+#elif defined (HAVE_POSIX_MEMALIGN)
+ posix_memalign(&ptr,16,size);
#elif defined (HAVE_MEMALIGN)
ptr = memalign(16,size);
/* Why 64?