FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
mem.h File Reference

memory handling functions More...

#include <limits.h>
#include <stdint.h>
#include "attributes.h"
#include "error.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(...)
 
#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(...)
 
#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 av_alloc_size(1)
 Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU).
 
 av_alloc_size (1, 2) static inline void *av_malloc_array(size_t nmemb
 Allocate a block of size * nmemb bytes with av_malloc().
 
return av_malloc (nmemb *size)
 
voidav_realloc (void *ptr, size_t size) av_alloc_size(2)
 Allocate or reallocate a block of memory.
 
voidav_realloc_f (void *ptr, size_t nelem, size_t elsize)
 Allocate or reallocate a block of memory.
 
int av_reallocp (void *ptr, size_t size)
 Allocate or reallocate a block of memory.
 
 av_alloc_size (2, 3) void *av_realloc_array(void *ptr
 Allocate or reallocate an array.
 
void av_free (void *ptr)
 Free a memory block which has been allocated with av_malloc(z)() or av_realloc().
 
voidav_mallocz (size_t size) av_malloc_attrib av_alloc_size(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.
 
voidav_calloc (size_t nmemb, size_t size) av_malloc_attrib
 Allocate a block of nmemb * size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.
 
return av_mallocz (nmemb *size)
 
char * av_strdup (const char *s) av_malloc_attrib
 Duplicate the string s.
 
voidav_memdup (const void *p, size_t size)
 Duplicate the buffer p.
 
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.
 
void av_dynarray_add (void *tab_ptr, int *nb_ptr, void *elem)
 Add an element to a dynamic array.
 
voidav_dynarray2_add (void **tab_ptr, int *nb_ptr, size_t elem_size, const uint8_t *elem_data)
 Add an element of size elem_size to a dynamic array.
 
static int av_size_mult (size_t a, size_t b, size_t *r)
 Multiply two size_t values checking for overflow.
 
void av_max_alloc (size_t max)
 Set the maximum size that may me allocated in one block.
 
void av_memcpy_backptr (uint8_t *dst, int back, int cnt)
 deliberately overlapping memcpy implementation
 
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.
 
void av_fast_malloc (void *ptr, unsigned int *size, size_t min_size)
 Allocate a buffer, reusing the given one if large enough.
 

Variables

size_t size
 
size_t nmemb
 

Detailed Description

memory handling functions

Definition in file mem.h.