configure: remove memalign check

Also, replace the only use of memalign: use av_malloc instead in sub.c.
(av_malloc allocates with the required alignment restrictions.)
This commit is contained in:
wm4 2012-07-30 21:13:03 +02:00
parent 7cdfd2ba39
commit 261243496e
2 changed files with 5 additions and 29 deletions

26
configure vendored
View File

@ -1724,28 +1724,6 @@ fi
echores "$_malloc"
echocheck "memalign()"
# XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
_memalign=no
statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
if test "$_memalign" = yes ; then
def_memalign='#define HAVE_MEMALIGN 1'
else
def_memalign='#define HAVE_MEMALIGN 0'
def_map_memalign='#define memalign(a, b) malloc(b)'
darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
fi
echores "$_memalign"
echocheck "posix_memalign()"
posix_memalign=no
def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
echores "$posix_memalign"
echocheck "alloca.h"
_alloca=no
@ -4387,8 +4365,6 @@ $def_gettimeofday
$def_glob
$def_langinfo
$def_lrintf
$def_map_memalign
$def_memalign
$def_nanosleep
$def_posix_select
$def_select
@ -4587,9 +4563,7 @@ $def_llrint
$def_log2
$def_log2f
$def_lrint
$def_memalign_hack
$def_mkstemp
$def_posix_memalign
$def_pthreads
$def_round
$def_roundf

View File

@ -20,6 +20,9 @@
#include <stdlib.h>
#include <string.h>
#include <libavutil/mem.h>
#include <libavutil/common.h>
#include "config.h"
#if HAVE_MALLOC_H
#include <malloc.h>
@ -38,7 +41,6 @@
#include "libvo/video_out.h"
#include "sub.h"
#include "spudec.h"
#include "libavutil/common.h"
char * const sub_osd_names[]={
@ -140,8 +142,8 @@ void osd_alloc_buf(mp_osd_obj_t* obj)
obj->allocated = len;
free(obj->bitmap_buffer);
free(obj->alpha_buffer);
obj->bitmap_buffer = memalign(16, len);
obj->alpha_buffer = memalign(16, len);
obj->bitmap_buffer = av_malloc(len);
obj->alpha_buffer = av_malloc(len);
}
memset(obj->bitmap_buffer, sub_bg_color, len);
memset(obj->alpha_buffer, sub_bg_alpha, len);