mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
optimize the 'quick response' code a bit more... no more malloc() or memset() for each response
expand stringfields API a bit to allow reusing the stringfield pool on a structure when needed, and remove some unnecessary code when the structure was being freed git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -664,7 +664,7 @@ struct ast_channel *ast_channel_alloc(int needqueue)
|
||||
if (needqueue) {
|
||||
if (pipe(tmp->alertpipe)) {
|
||||
ast_log(LOG_WARNING, "Channel allocation failed: Can't create alert pipe!\n");
|
||||
ast_string_field_free_all(tmp);
|
||||
ast_string_field_free_pools(tmp);
|
||||
free(tmp);
|
||||
return NULL;
|
||||
} else {
|
||||
@@ -1061,7 +1061,7 @@ void ast_channel_free(struct ast_channel *chan)
|
||||
/* Destroy the jitterbuffer */
|
||||
ast_jb_destroy(chan);
|
||||
|
||||
ast_string_field_free_all(chan);
|
||||
ast_string_field_free_pools(chan);
|
||||
free(chan);
|
||||
AST_LIST_UNLOCK(&channels);
|
||||
|
||||
|
Reference in New Issue
Block a user