[asterisk-commits] trunk r21681 - /trunk/include/asterisk/utils.h

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 19 15:32:08 MST 2006


Author: russell
Date: Wed Apr 19 17:32:07 2006
New Revision: 21681

URL: http://svn.digium.com/view/asterisk?rev=21681&view=rev
Log:
add the malloc attribute to the memory allocation wrappers

Modified:
    trunk/include/asterisk/utils.h

Modified: trunk/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/utils.h?rev=21681&r1=21680&r2=21681&view=diff
==============================================================================
--- trunk/include/asterisk/utils.h (original)
+++ trunk/include/asterisk/utils.h Wed Apr 19 17:32:07 2006
@@ -266,7 +266,7 @@
 	_ast_malloc((len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
 AST_INLINE_API(
-void *_ast_malloc(size_t len, const char *file, int lineno, const char *func),
+void * __attribute__((malloc)) _ast_malloc(size_t len, const char *file, int lineno, const char *func),
 {
 	void *p;
 
@@ -291,7 +291,7 @@
 	_ast_calloc((num), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
 AST_INLINE_API(
-void *_ast_calloc(size_t num, size_t len, const char *file, int lineno, const char *func),
+void * __attribute__((malloc)) _ast_calloc(size_t num, size_t len, const char *file, int lineno, const char *func),
 {
 	void *p;
 
@@ -316,7 +316,7 @@
 	_ast_realloc((p), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
 AST_INLINE_API(
-void *_ast_realloc(void *p, size_t len, const char *file, int lineno, const char *func),
+void * __attribute__((malloc)) _ast_realloc(void *p, size_t len, const char *file, int lineno, const char *func),
 {
 	void *newp;
 
@@ -345,7 +345,7 @@
 	_ast_strdup((str), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
 AST_INLINE_API(
-char *_ast_strdup(const char *str, const char *file, int lineno, const char *func),
+char * __attribute__((malloc)) _ast_strdup(const char *str, const char *file, int lineno, const char *func),
 {
 	char *newstr = NULL;
 
@@ -376,7 +376,7 @@
 	_ast_strndup((str), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
 AST_INLINE_API(
-char *_ast_strndup(const char *str, size_t len, const char *file, int lineno, const char *func),
+char * __attribute__((malloc)) _ast_strndup(const char *str, size_t len, const char *file, int lineno, const char *func),
 {
 	char *newstr = NULL;
 



More information about the asterisk-commits mailing list