]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make chan_local locals container an explicit list container.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 1 May 2013 20:59:29 +0000 (20:59 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 1 May 2013 20:59:29 +0000 (20:59 +0000)
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

index cb86873b18c3798d4f3f433e7dde7195645696f5..52e496b07dd68e7e70e1d2c7746d3fc1c9a00567 100644 (file)
@@ -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;
        }