diff options
author | Panagiotis Issaris <takis.issaris@uhasselt.be> | 2007-03-12 14:45:49 +0000 |
---|---|---|
committer | Panagiotis Issaris <takis.issaris@uhasselt.be> | 2007-03-12 14:45:49 +0000 |
commit | 792098c2ec867e151b8457d6b99978cd074db04e (patch) | |
tree | 74208222e3dca3995dc99cda77942b6a4f81193b /libavutil/common.h | |
parent | 1420b8375dcb338cc9287c3436e5fffc0fc456c3 (diff) | |
download | ffmpeg-792098c2ec867e151b8457d6b99978cd074db04e.tar.gz |
Move the memory related functions out of common.h into their own header file
mem.h.
Originally committed as revision 8342 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/common.h')
-rw-r--r-- | libavutil/common.h | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/libavutil/common.h b/libavutil/common.h index 84e6e19e49..9ec5c7c781 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -63,6 +63,8 @@ #endif #endif +#include "mem.h" + //rounded divison & shift #define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b)) /* assume b>0 */ @@ -321,44 +323,4 @@ tend= read_time();\ #define STOP_TIMER(id) {} #endif -/* memory */ - -#ifdef __GNUC__ - #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n))) -#else - #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v -#endif - -/* memory */ - -/** - * Memory allocation of size byte with alignment suitable for all - * memory accesses (including vectors if available on the - * CPU). av_malloc(0) must return a non NULL pointer. - */ -void *av_malloc(unsigned int size); - -/** - * av_realloc semantics (same as glibc): if ptr is NULL and size > 0, - * identical to malloc(size). If size is zero, it is identical to - * free(ptr) and NULL is returned. - */ -void *av_realloc(void *ptr, unsigned int size); - -/** - * Free memory which has been allocated with av_malloc(z)() or av_realloc(). - * NOTE: ptr = NULL is explicetly allowed - * Note2: it is recommended that you use av_freep() instead - */ -void av_free(void *ptr); - -void *av_mallocz(unsigned int size); -char *av_strdup(const char *s); - -/** - * Frees memory and sets the pointer to NULL. - * @param ptr pointer to the pointer which should be freed - */ -void av_freep(void *ptr); - #endif /* COMMON_H */ |