From: Tilghman Lesher Date: Mon, 29 Jun 2009 17:56:29 +0000 (+0000) Subject: Allow trunk to once again compile under MALLOC_DEBUG X-Git-Tag: 11.0.0-beta1~4576 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5f6eac49e7aabe9315f8c5149acc66b4825a1a4;p=thirdparty%2Fasterisk.git Allow trunk to once again compile under MALLOC_DEBUG git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204118 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 496e477a22..ddd5e9e80c 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -940,7 +940,12 @@ struct ast_channel * attribute_malloc __attribute__((format(printf, 13, 14))) * that can then be populated with data for use in variable * substitution when a real channel does not exist. */ +#if defined(REF_DEBUG) || defined(__AST_DEBUG_MALLOC) +#define ast_dummy_channel_alloc() __ast_dummy_channel_alloc(__FILE__, __LINE__, __PRETTY_FUNCTION__) +struct ast_channel *__ast_dummy_channel_alloc(const char *file, int line, const char *function); +#else struct ast_channel *ast_dummy_channel_alloc(void); +#endif /*! * \brief Queue one or more frames to a channel's frame queue diff --git a/main/channel.c b/main/channel.c index f33de43eaf..a95e8f2178 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1021,17 +1021,21 @@ struct ast_channel *__ast_channel_alloc(int needqueue, int state, const char *ci /* only do the minimum amount of work needed here to make a channel * structure that can be used to expand channel vars */ +#if defined(REF_DEBUG) || defined(__AST_DEBUG_MALLOC) +struct ast_channel *__ast_dummy_channel_alloc(const char *file, int line, const char *function) +#else struct ast_channel *ast_dummy_channel_alloc(void) +#endif { struct ast_channel *tmp; struct varshead *headp; #if defined(REF_DEBUG) - if (!(tmp = __ao2_alloc_debug(sizeof(*tmp), ast_dummy_channel_destructor, "", file, line, function, 1))) { + if (!(tmp = __ao2_alloc_debug(sizeof(*tmp), ast_dummy_channel_destructor, "dummy channel", file, line, function, 1))) { return NULL; } #elif defined(__AST_DEBUG_MALLOC) - if (!(tmp = __ao2_alloc_debug(sizeof(*tmp), ast_dummy_channel_destructor, "", file, line, function, 0))) { + if (!(tmp = __ao2_alloc_debug(sizeof(*tmp), ast_dummy_channel_destructor, "dummy channel", file, line, function, 0))) { return NULL; } #else