diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-29 20:50:36 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-29 20:50:36 +0000 |
commit | 53f8d43e2945038fe3059fd6c1c00dd4ec117505 (patch) | |
tree | 0f3fc04bcb07ac328d54ffb2fed0333dfffb44de /channels/chan_local.c | |
parent | 562decf81af443d24afd3f1fc3d133b8b2b7cee3 (diff) |
Merge team/russell/frame_caching
There are some situations in Asterisk where ast_frame and/or iax_frame
structures are rapidly allocatted and freed (at least 50 times per second
for one call).
This code significantly improves the performance of ast_frame_header_new(),
ast_frdup(), ast_frfree(), iax_frame_new(), and iax_frame_free() by keeping
a thread-local cache of these structures and using frames from the cache
whenever possible instead of calling malloc/free every time.
This commit also converts the ast_frame and iax_frame structures to use the
linked list macros.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41278 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r-- | channels/chan_local.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index 815f9cc1a..a9b0582f9 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -226,7 +226,7 @@ static void check_bridge(struct local_pvt *p, int isoutbound) frames on the owner channel (because they would be transferred to the outbound channel during the masquerade) */ - if (isoutbound && p->chan->_bridge /* Not ast_bridged_channel! Only go one step! */ && !p->owner->readq) { + if (isoutbound && p->chan->_bridge /* Not ast_bridged_channel! Only go one step! */ && AST_LIST_EMPTY(&p->owner->readq)) { /* Masquerade bridged channel into owner */ /* Lock everything we need, one by one, and give up if we can't get everything. Remember, we'll get another @@ -248,7 +248,7 @@ static void check_bridge(struct local_pvt *p, int isoutbound) when the local channels go away. */ #if 0 - } else if (!isoutbound && p->owner && p->owner->_bridge && p->chan && !p->chan->readq) { + } else if (!isoutbound && p->owner && p->owner->_bridge && p->chan && AST_LIST_EMPTY(&p->chan->readq)) { /* Masquerade bridged channel into chan */ if (!ast_mutex_trylock(&(p->owner->_bridge)->lock)) { if (!p->owner->_bridge->_softhangup) { |