# HG changeset patch # User lu_zero # Date 1159197820 0 # Node ID c3643ddcbaab820142eed19388b59c71fd8335cd # Parent 271eca88821bca34f4ec1558f93b6a813f3b30d5 move memory functions from avcodec to avutil diff -r 271eca88821b -r c3643ddcbaab avcodec.h --- a/avcodec.h Sun Sep 24 10:58:06 2006 +0000 +++ b/avcodec.h Mon Sep 25 15:23:40 2006 +0000 @@ -35,8 +35,8 @@ #define AV_STRINGIFY(s) AV_TOSTRING(s) #define AV_TOSTRING(s) #s -#define LIBAVCODEC_VERSION_INT ((51<<16)+(14<<8)+0) -#define LIBAVCODEC_VERSION 51.14.0 +#define LIBAVCODEC_VERSION_INT ((51<<16)+(15<<8)+0) +#define LIBAVCODEC_VERSION 51.15.0 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) @@ -2633,9 +2633,6 @@ /* memory */ -void *av_mallocz(unsigned int size); -char *av_strdup(const char *s); -void av_freep(void *ptr); void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size); /* for static data only */ /* call av_free_static to release all staticaly allocated tables */ diff -r 271eca88821b -r c3643ddcbaab utils.c --- a/utils.c Sun Sep 24 10:58:06 2006 +0000 +++ b/utils.c Mon Sep 25 15:23:40 2006 +0000 @@ -57,29 +57,6 @@ static int volatile entangled_thread_counter=0; -void *av_mallocz(unsigned int size) -{ - void *ptr; - - ptr = av_malloc(size); - if (!ptr) - return NULL; - memset(ptr, 0, size); - return ptr; -} - -char *av_strdup(const char *s) -{ - char *ptr; - int len; - len = strlen(s) + 1; - ptr = av_malloc(len); - if (!ptr) - return NULL; - memcpy(ptr, s, len); - return ptr; -} - /** * realloc which does nothing if the block is large enough */ @@ -93,7 +70,6 @@ return av_realloc(ptr, *size); } - static unsigned int last_static = 0; static unsigned int allocated_static = 0; static void** array_static = NULL; @@ -157,16 +133,6 @@ av_free_static(); } -/** - * 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); - *ptr = NULL; -} /* encoder management */ AVCodec *first_avcodec = NULL;