FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
Function Attributes

Function attributes applicable to memory handling functions. More...

Macros

#define av_malloc_attrib   __attribute__((__malloc__))
 Function attribute denoting a malloc-like function. More...
 
#define av_alloc_size(...)   __attribute__((alloc_size(__VA_ARGS__)))
 Function attribute used on a function that allocates memory, whose size is given by the specified parameter(s). More...
 

Detailed Description

Function attributes applicable to memory handling functions.

These function attributes can help compilers emit more useful warnings, or generate better code.

Macro Definition Documentation

#define av_malloc_attrib   __attribute__((__malloc__))

Function attribute denoting a malloc-like function.

See Also
Function attribute malloc in GCC's documentation

Definition at line 135 of file mem.h.

#define av_alloc_size (   ...)    __attribute__((alloc_size(__VA_ARGS__)))

Function attribute used on a function that allocates memory, whose size is given by the specified parameter(s).

void *av_malloc(size_t size) av_alloc_size(1);
void *av_calloc(size_t nmemb, size_t size) av_alloc_size(1, 2);
Parameters
...One or two parameter indexes, separated by a comma
See Also
Function attribute alloc_size in GCC's documentation

Definition at line 156 of file mem.h.