diff mem.c @ 1026:d6ba0641cc36 libavcodec

cleanup
author michaelni
date Tue, 21 Jan 2003 21:30:48 +0000
parents 5d4c95f323d0
children 19de1445beb2
line wrap: on
line diff
--- a/mem.c	Tue Jan 21 17:34:12 2003 +0000
+++ b/mem.c	Tue Jan 21 21:30:48 2003 +0000
@@ -71,6 +71,17 @@
     return ptr;
 }
 
+/**
+ * realloc which does nothing if the block is large enogh
+ */
+void *av_fast_realloc(void *ptr, int *size, int min_size){
+    if(min_size < *size) return ptr;
+    
+    *size= min_size + 10*1024;
+
+    return realloc(ptr, *size);
+}
+
 /* NOTE: ptr = NULL is explicetly allowed */
 void av_free(void *ptr)
 {