macrofree av_freep()
Originally committed as revision 2839 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -2073,8 +2073,7 @@ void *av_mallocz(unsigned int size);
|
|||||||
void *av_realloc(void *ptr, unsigned int size);
|
void *av_realloc(void *ptr, unsigned int size);
|
||||||
void av_free(void *ptr);
|
void av_free(void *ptr);
|
||||||
char *av_strdup(const char *s);
|
char *av_strdup(const char *s);
|
||||||
void __av_freep(void **ptr);
|
void av_freep(void *ptr);
|
||||||
#define av_freep(p) __av_freep((void **)(p))
|
|
||||||
void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
|
void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
|
||||||
/* for static data only */
|
/* for static data only */
|
||||||
/* call av_free_static to release all staticaly allocated tables */
|
/* call av_free_static to release all staticaly allocated tables */
|
||||||
|
|||||||
@@ -103,9 +103,13 @@ void av_free_static(void)
|
|||||||
last_static = 0;
|
last_static = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cannot call it directly because of 'void **' casting is not automatic */
|
/**
|
||||||
void __av_freep(void **ptr)
|
* Frees memory and sets the pointer to NULL.
|
||||||
|
* @param arg pointer to the pointer which should be freed
|
||||||
|
*/
|
||||||
|
void av_freep(void *arg)
|
||||||
{
|
{
|
||||||
|
void **ptr= (void**)arg;
|
||||||
av_free(*ptr);
|
av_free(*ptr);
|
||||||
*ptr = NULL;
|
*ptr = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user