diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-05 12:27:18 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-05 12:27:18 +0000 |
commit | b1ee3cb350dd9f9201c3587a76f6cf7fdcf3f8ae (patch) | |
tree | 02dde95f8e7d1fc91ee823f72ac379ca6a15c06f /include | |
parent | 175af3db91cccbb4ce8035ae68f8613917d6c4bb (diff) |
Merged revisions 192318 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r192318 | kpfleming | 2009-05-05 12:34:19 +0200 (Tue, 05 May 2009) | 5 lines
Properly account for memory allocated for channels and datastores
As in previous commits, when channels are allocated (with ast_channel_alloc) or datastores are allocated (with ast_datastore_alloc) properly account for the memory being owned by the caller, instead of the allocator function itself.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@192353 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/channel.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index e20cae96d..202ecf3dc 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -729,7 +729,16 @@ int ast_setstate(struct ast_channel *chan, enum ast_channel_state); * \note By default, new channels are set to the "s" extension * and "default" context. */ -struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_num, const char *cid_name, const char *acctcode, const char *exten, const char *context, const int amaflag, const char *name_fmt, ...) __attribute__((format(printf, 9, 10))); +struct ast_channel * attribute_malloc __attribute__((format(printf, 12, 13))) + __ast_channel_alloc(int needqueue, int state, const char *cid_num, + const char *cid_name, const char *acctcode, + const char *exten, const char *context, + const int amaflag, const char *file, int line, + const char *function, const char *name_fmt, ...); + +#define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, amaflag, ...) \ + __ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, amaflag, \ + __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__) /*! * \brief Queue an outgoing frame |