From e6f7de360d9d088b0b728585435e137503977a71 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Wed, 1 May 2013 20:59:29 +0000 Subject: Make chan_local locals container an explicit list container. Pretending that chan_local locals container can have more than one bucket is silly. The container has no key to help search. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387211 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_local.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/channels/chan_local.c b/channels/chan_local.c index cb86873b1..52e496b07 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -78,11 +78,6 @@ static const char tdesc[] = "Local Proxy Channel Driver"; #define IS_OUTBOUND(a,b) (a == b->chan ? 1 : 0) -/* right now we are treating the locals astobj2 container as a - * list. If there is ever a reason to make this more efficient - * increasing the bucket size would help. */ -static const int BUCKET_SIZE = 1; - static struct ao2_container *locals; static unsigned int name_sequence = 0; @@ -1429,7 +1424,8 @@ static int load_module(void) } ast_format_cap_add_all(local_tech.capabilities); - if (!(locals = ao2_container_alloc(BUCKET_SIZE, NULL, locals_cmp_cb))) { + locals = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_MUTEX, 0, NULL, locals_cmp_cb); + if (!locals) { ast_format_cap_destroy(local_tech.capabilities); return AST_MODULE_LOAD_FAILURE; } -- cgit v1.2.3