[asterisk-commits] rmudgett: trunk r387211 - /trunk/channels/chan_local.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 1 15:59:32 CDT 2013


Author: rmudgett
Date: Wed May  1 15:59:29 2013
New Revision: 387211

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387211
Log:
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.

Modified:
    trunk/channels/chan_local.c

Modified: trunk/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_local.c?view=diff&rev=387211&r1=387210&r2=387211
==============================================================================
--- trunk/channels/chan_local.c (original)
+++ trunk/channels/chan_local.c Wed May  1 15:59:29 2013
@@ -77,11 +77,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;
 
@@ -1429,7 +1424,8 @@
 	}
 	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;
 	}




More information about the asterisk-commits mailing list