libavutil/mem.h File Reference

#include "attributes.h"

Go to the source code of this file.

Defines

#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(n)

Functions

void * av_malloc (unsigned int size) av_malloc_attrib av_alloc_size(1)
 Allocates a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU).
void * av_realloc (void *ptr, unsigned int size) av_alloc_size(2)
 Allocates or reallocates a block of memory.
void av_free (void *ptr)
 Frees a memory block which has been allocated with av_malloc(z)() or av_realloc().
void * av_mallocz (unsigned int size) av_malloc_attrib av_alloc_size(1)
 Allocates a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zeroes all the bytes of the block.
char * av_strdup (const char *s) av_malloc_attrib
 Duplicates the string s.
void av_freep (void *ptr)
 Frees a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer pointing to it to NULL.


Define Documentation

#define av_alloc_size (  ) 

Definition at line 61 of file mem.h.

#define av_malloc_attrib

Definition at line 55 of file mem.h.

#define DECLARE_ALIGNED ( n,
t,
 )     t v

Definition at line 48 of file mem.h.

#define DECLARE_ASM_CONST ( n,
t,
 )     static const t v

Definition at line 49 of file mem.h.


Function Documentation

void av_free ( void *  ptr  ) 

Frees a memory block which has been allocated with av_malloc(z)() or av_realloc().

Parameters:
ptr Pointer to the memory block which should be freed.
Note:
ptr = NULL is explicitly allowed.

It is recommended that you use av_freep() instead.

See also:
av_freep()

Definition at line 139 of file mem.c.

void av_freep ( void *  ptr  ) 

Frees a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer pointing to it to NULL.

Parameters:
ptr Pointer to the pointer to the memory block which should be freed.
See also:
av_free()

Definition at line 150 of file mem.c.

void* av_malloc ( unsigned int  size  ) 

Allocates a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU).

Parameters:
size Size in bytes for the memory block to be allocated.
Returns:
Pointer to the allocated block, NULL if the block cannot be allocated.
See also:
av_mallocz()

Definition at line 64 of file mem.c.

void* av_mallocz ( unsigned int  size  ) 

Allocates a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zeroes all the bytes of the block.

Parameters:
size Size in bytes for the memory block to be allocated.
Returns:
Pointer to the allocated block, NULL if it cannot be allocated.
See also:
av_malloc()

Definition at line 157 of file mem.c.

void* av_realloc ( void *  ptr,
unsigned int  size 
)

Allocates or reallocates a block of memory.

If ptr is NULL and size > 0, allocates a new block. If size is zero, frees the memory block pointed to by ptr.

Parameters:
size Size in bytes for the memory block to be allocated or reallocated.
ptr Pointer to a memory block already allocated with av_malloc(z)() or av_realloc() or NULL.
Returns:
Pointer to a newly reallocated block or NULL if the block cannot be reallocated or the function is used to free the memory block.
See also:
av_fast_realloc()

Definition at line 119 of file mem.c.

char* av_strdup ( const char *  s  ) 

Duplicates the string s.

Parameters:
s string to be duplicated
Returns:
Pointer to a newly allocated string containing a copy of s or NULL if the string cannot be allocated.

Definition at line 165 of file mem.c.


Generated on Tue Apr 20 17:39:21 2010 for FFmpeg by  doxygen 1.5.6