diff options
author | Zuxy Meng <zuxy.meng@gmail.com> | 2008-03-18 15:27:15 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2008-03-18 15:27:15 +0000 |
commit | 6544f48f038552973a552401cea5d4e8f1fc9c0a (patch) | |
tree | df001b9633d7c0cd7407cc0566e21917edf73d7b /libavutil/mem.h | |
parent | 38c669d853dfa60a73bf59695ff03e7104650623 (diff) | |
download | ffmpeg-streaming-6544f48f038552973a552401cea5d4e8f1fc9c0a.zip ffmpeg-streaming-6544f48f038552973a552401cea5d4e8f1fc9c0a.tar.gz |
Pure, const and malloc attributes to libavutil.
Patch by Zuxy Meng: zuxy meng gmail com
Original thread:
[FFmpeg-devel] [PATCH] Pure, const and malloc attributes to libavutil
Date: 03/18/2008 6:09 AM
Originally committed as revision 12489 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/mem.h')
-rw-r--r-- | libavutil/mem.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavutil/mem.h b/libavutil/mem.h index f8df42c..c68117d 100644 --- a/libavutil/mem.h +++ b/libavutil/mem.h @@ -42,6 +42,12 @@ #define DECLARE_ASM_CONST(n,t,v) static const t v #endif +#ifdef __GNUC__ + #define av_malloc_attrib __attribute__((__malloc__)) +#else + #define av_malloc_attrib +#endif + /** * Allocate a block of \p size bytes with alignment suitable for all * memory accesses (including vectors if available on the CPU). @@ -50,7 +56,7 @@ * it. * @see av_mallocz() */ -void *av_malloc(unsigned int size); +void *av_malloc(unsigned int size) av_malloc_attrib; /** * Allocate or reallocate a block of memory. @@ -85,7 +91,7 @@ void av_free(void *ptr); * it. * @see av_malloc() */ -void *av_mallocz(unsigned int size); +void *av_mallocz(unsigned int size) av_malloc_attrib; /** * Duplicate the string \p s. @@ -93,7 +99,7 @@ void *av_mallocz(unsigned int size); * @return Pointer to a newly allocated string containing a * copy of \p s or NULL if it cannot be allocated. */ -char *av_strdup(const char *s); +char *av_strdup(const char *s) av_malloc_attrib; /** * Free a memory block which has been allocated with av_malloc(z)() or |