41 #if defined(__ICC) && __ICC < 1200 || defined(__SUNPRO_C)
42 #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
43 #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
44 #elif defined(__TI_COMPILER_VERSION__)
45 #define DECLARE_ALIGNED(n,t,v) \
46 AV_PRAGMA(DATA_ALIGN(v,n)) \
47 t __attribute__((aligned(n))) v
48 #define DECLARE_ASM_CONST(n,t,v) \
49 AV_PRAGMA(DATA_ALIGN(v,n)) \
50 static const t __attribute__((aligned(n))) v
51 #elif defined(__GNUC__)
52 #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
53 #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
54 #elif defined(_MSC_VER)
55 #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
56 #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
58 #define DECLARE_ALIGNED(n,t,v) t v
59 #define DECLARE_ASM_CONST(n,t,v) static const t v
62 #if AV_GCC_VERSION_AT_LEAST(3,1)
63 #define av_malloc_attrib __attribute__((__malloc__))
65 #define av_malloc_attrib
68 #if AV_GCC_VERSION_AT_LEAST(4,3)
69 #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
71 #define av_alloc_size(...)
94 if (!size || nmemb >= INT_MAX / size)
207 if (!size || nmemb >= INT_MAX / size)
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Macro definitions for various function/variable attributes.
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
int av_reallocp(void *ptr, size_t size)
Allocate or reallocate a block of memory.
#define av_alloc_size(...)
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given block if it is not large enough, otherwise do nothing.
char * av_strdup(const char *s) av_malloc_attrib
Duplicate the string s.
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
static void * av_malloc_array(size_t nmemb, size_t size)
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
Allocate a buffer, reusing the given one if large enough.
void * av_realloc(void *ptr, size_t size) 1(2)
Allocate or reallocate a block of memory.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
static void * av_mallocz_array(size_t nmemb, size_t size)
void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
deliberately overlapping memcpy implementation
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...