Mercurial > audlegacy
comparison Plugins/Input/wma/libffwma/mem.c @ 1540:237bb7c97759 trunk
[svn] - use posix_memalign() instead of memalign().
author | nenolod |
---|---|
date | Wed, 09 Aug 2006 02:11:01 -0700 |
parents | 57de7a460283 |
children | 9937a2512823 |
comparison
equal
deleted
inserted
replaced
1539:850f1eba9cbd | 1540:237bb7c97759 |
---|---|
27 /* here we can use OS dependant allocation functions */ | 27 /* here we can use OS dependant allocation functions */ |
28 #undef malloc | 28 #undef malloc |
29 #undef free | 29 #undef free |
30 #undef realloc | 30 #undef realloc |
31 | 31 |
32 #ifdef HAVE_MALLOC_H | 32 #define _XOPEN_SOURCE 600 |
33 #include <malloc.h> | 33 #include <stdlib.h> |
34 #endif | |
35 | 34 |
36 /* you can redefine av_malloc and av_free in your project to use your | 35 /* you can redefine av_malloc and av_free in your project to use your |
37 memory allocator. You do not need to suppress this file because the | 36 memory allocator. You do not need to suppress this file because the |
38 linker will do it automatically */ | 37 linker will do it automatically */ |
39 | 38 |
42 * memory accesses (including vectors if available on the | 41 * memory accesses (including vectors if available on the |
43 * CPU). av_malloc(0) must return a non NULL pointer. | 42 * CPU). av_malloc(0) must return a non NULL pointer. |
44 */ | 43 */ |
45 void *av_malloc(unsigned int size) | 44 void *av_malloc(unsigned int size) |
46 { | 45 { |
47 return memalign(16,size); | 46 void *ptr; |
47 | |
48 posix_memalign(&ptr, 16, size); | |
49 | |
50 return ptr; | |
48 } | 51 } |
49 | 52 |
50 /** | 53 /** |
51 * av_realloc semantics (same as glibc): if ptr is NULL and size > 0, | 54 * av_realloc semantics (same as glibc): if ptr is NULL and size > 0, |
52 * identical to malloc(size). If size is zero, it is identical to | 55 * identical to malloc(size). If size is zero, it is identical to |