Mercurial > libavcodec.hg
diff utils.c @ 3758:c3643ddcbaab libavcodec
move memory functions from avcodec to avutil
author | lu_zero |
---|---|
date | Mon, 25 Sep 2006 15:23:40 +0000 |
parents | 0882d618eb57 |
children | c38b14835b62 |
line wrap: on
line diff
--- 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;