[asterisk-commits] jpeeler: branch jpeeler/bug13593-2 r180781 - in /team/jpeeler/bug13593-2: cha...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Mar 9 17:24:47 CDT 2009
Author: jpeeler
Date: Mon Mar 9 17:24:44 2009
New Revision: 180781
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=180781
Log:
Commit current work
Modified:
team/jpeeler/bug13593-2/channels/h323/ast_h323.cxx
team/jpeeler/bug13593-2/include/asterisk/astmm.h
team/jpeeler/bug13593-2/include/asterisk/utils.h
team/jpeeler/bug13593-2/main/astmm.c
Modified: team/jpeeler/bug13593-2/channels/h323/ast_h323.cxx
URL: http://svn.digium.com/svn-view/asterisk/team/jpeeler/bug13593-2/channels/h323/ast_h323.cxx?view=diff&rev=180781&r1=180780&r2=180781
==============================================================================
--- team/jpeeler/bug13593-2/channels/h323/ast_h323.cxx (original)
+++ team/jpeeler/bug13593-2/channels/h323/ast_h323.cxx Mon Mar 9 17:24:44 2009
@@ -140,7 +140,9 @@
int PAsteriskLog::Buffer::sync()
{
- char *str = strdup(string);
+ //char *str = strdup(string.ToLiteral());
+ //#undef strdup
+ char *str = ast_strdup(string);
char *s, *s1;
char c;
@@ -156,7 +158,8 @@
ast_verbose("%s", s);
*s1 = c;
}
- free(str);
+ ast_free(str);
+ //__ast_free(str, "file", 1000, "here");
string = PString();
char *base = string.GetPointer(2000);
Modified: team/jpeeler/bug13593-2/include/asterisk/astmm.h
URL: http://svn.digium.com/svn-view/asterisk/team/jpeeler/bug13593-2/include/asterisk/astmm.h?view=diff&rev=180781&r1=180780&r2=180781
==============================================================================
--- team/jpeeler/bug13593-2/include/asterisk/astmm.h (original)
+++ team/jpeeler/bug13593-2/include/asterisk/astmm.h Mon Mar 9 17:24:44 2009
@@ -19,6 +19,11 @@
/*! \file
* \brief Asterisk memory usage debugging
*/
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifndef _ASTERISK_ASTMM_H
#define _ASTERISK_ASTMM_H
@@ -42,6 +47,7 @@
#undef strndup
#undef asprintf
#undef vasprintf
+#undef free
void *__ast_calloc(size_t nmemb, size_t size, const char *file, int lineno, const char *func);
void *__ast_calloc_cache(size_t nmemb, size_t size, const char *file, int lineno, const char *func);
@@ -61,30 +67,58 @@
#define calloc(a,b) \
__ast_calloc(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ast_calloc(a,b) \
+ __ast_calloc(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+
#define ast_calloc_cache(a,b) \
__ast_calloc_cache(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#define malloc(a) \
__ast_malloc(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ast_malloc(a) \
+ __ast_malloc(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+
#define free(a) \
+ __ast_free(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+#define ast_free(a) \
__ast_free(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#define realloc(a,b) \
__ast_realloc(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ast_realloc(a,b) \
+ __ast_realloc(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+
#define strdup(a) \
+ __ast_strdup(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+#define ast_strdup(a) \
__ast_strdup(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#define strndup(a,b) \
__ast_strndup(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ast_strndup(a,b) \
+ __ast_strndup(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+
#define asprintf(a, b, c...) \
+ __ast_asprintf(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, b, c)
+
+#define ast_asprintf(a, b, c...) \
__ast_asprintf(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, b, c)
#define vasprintf(a,b,c) \
__ast_vasprintf(a,b,c,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ast_vasprintf(a,b,c) \
+ __ast_vasprintf(a,b,c,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+
#else
#error "NEVER INCLUDE astmm.h DIRECTLY!!"
#endif /* _ASTERISK_ASTMM_H */
+
+#ifdef __cplusplus
+}
+#endif
Modified: team/jpeeler/bug13593-2/include/asterisk/utils.h
URL: http://svn.digium.com/svn-view/asterisk/team/jpeeler/bug13593-2/include/asterisk/utils.h?view=diff&rev=180781&r1=180780&r2=180781
==============================================================================
--- team/jpeeler/bug13593-2/include/asterisk/utils.h (original)
+++ team/jpeeler/bug13593-2/include/asterisk/utils.h Mon Mar 9 17:24:44 2009
@@ -398,7 +398,6 @@
long int ast_random(void);
-#define ast_free free
/*!
* \brief free() wrapper
@@ -413,6 +412,7 @@
ast_free(ptr);
}
#else
+#define ast_free free
#define ast_free_ptr ast_free
#endif
@@ -603,13 +603,13 @@
/* If astmm is in use, let it handle these. Otherwise, it will report that
all allocations are coming from this header file */
-#define ast_malloc(a) malloc(a)
-#define ast_calloc(a,b) calloc(a,b)
-#define ast_realloc(a,b) realloc(a,b)
-#define ast_strdup(a) strdup(a)
-#define ast_strndup(a,b) strndup(a,b)
-#define ast_asprintf(a,b,...) asprintf(a,b,__VA_ARGS__)
-#define ast_vasprintf(a,b,c) vasprintf(a,b,c)
+//#define ast_malloc(a) malloc(a)
+//#define ast_calloc(a,b) calloc(a,b)
+//#define ast_realloc(a,b) realloc(a,b)
+//#define ast_strdup(a) strdup(a)
+//#define ast_strndup(a,b) strndup(a,b)
+//#define ast_asprintf(a,b,...) asprintf(a,b,__VA_ARGS__)
+//#define ast_vasprintf(a,b,c) vasprintf(a,b,c)
#endif /* AST_DEBUG_MALLOC */
Modified: team/jpeeler/bug13593-2/main/astmm.c
URL: http://svn.digium.com/svn-view/asterisk/team/jpeeler/bug13593-2/main/astmm.c?view=diff&rev=180781&r1=180780&r2=180781
==============================================================================
--- team/jpeeler/bug13593-2/main/astmm.c (original)
+++ team/jpeeler/bug13593-2/main/astmm.c Mon Mar 9 17:24:44 2009
@@ -259,6 +259,7 @@
return NULL;
len = strlen(s) + 1;
+//ast_log(LOG_WARNING, "jpeeler: s ->> |%s| with len = %d\n", s, (int )len);
if ((ptr = __ast_alloc_region(len, FUNC_STRDUP, file, lineno, func, 0)))
strcpy(ptr, s);
More information about the asterisk-commits
mailing list