Libav
Macros | Functions
mem.h File Reference

memory handling functions More...

#include <limits.h>
#include <stdint.h>
#include "attributes.h"
#include "avutil.h"

Go to the source code of this file.

Macros

#define DECLARE_ALIGNED(n, t, v)   t v
 
#define DECLARE_ASM_CONST(n, t, v)   static const t v
 
#define av_malloc_attrib
 
#define av_alloc_size(...)
 

Functions

voidav_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 available on the CPU). More...
 
static voidav_malloc_array (size_t nmemb, size_t size)
 
voidav_realloc (void *ptr, size_t size) 1(2)
 Allocate or reallocate a block of memory. More...
 
int av_reallocp (void *ptr, size_t size)
 Allocate or reallocate a block of memory. More...
 
voidav_realloc_array (void *ptr, size_t nmemb, size_t 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(). More...
 
voidav_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 available on the CPU) and zero all the bytes of the block. More...
 
static voidav_mallocz_array (size_t nmemb, size_t size)
 
char * av_strdup (const char *s) av_malloc_attrib
 Duplicate the string s. More...
 
char * av_strndup (const char *s, size_t len) av_malloc_attrib
 Duplicate a substring of the string s. More...
 
void av_freep (void *ptr)
 Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer pointing to it to NULL. More...
 
void av_memcpy_backptr (uint8_t *dst, int back, int cnt)
 deliberately overlapping memcpy implementation More...
 
voidav_fast_realloc (void *ptr, unsigned int *size, size_t min_size)
 Reallocate the given block if it is not large enough, otherwise do nothing. More...
 
void av_fast_malloc (void *ptr, unsigned int *size, size_t min_size)
 Allocate a buffer, reusing the given one if large enough. More...
 

Detailed Description

memory handling functions

Definition in file mem.h.

Function Documentation

static void* av_malloc_array ( size_t  nmemb,
size_t  size 
)
inlinestatic

Definition at line 92 of file mem.h.

static void* av_mallocz_array ( size_t  nmemb,
size_t  size 
)
inlinestatic

Definition at line 205 of file mem.h.