summaryrefslogtreecommitdiff
path: root/main/endpoints.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-03-10 23:09:17 +0000
committerJoshua Colp <jcolp@digium.com>2015-03-10 23:09:17 +0000
commitbc357c1d7efd2fc7fce8c21fd472f437a9f6a7df (patch)
treec72ebb551aa4436d963ec79844e1feaa62fc123b /main/endpoints.c
parentafea98dc735a6a7a76b21edc93174f1102329165 (diff)
core: Don't create snapshots with locks.
Snapshots are immutable and are never changed. Allocating them with a lock is wasteful. Review: https://reviewboard.asterisk.org/r/4469/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@432742 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/endpoints.c')
-rw-r--r--main/endpoints.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main/endpoints.c b/main/endpoints.c
index f8cca45b8..3a6f494c0 100644
--- a/main/endpoints.c
+++ b/main/endpoints.c
@@ -467,9 +467,10 @@ struct ast_endpoint_snapshot *ast_endpoint_snapshot_create(
channel_count = ao2_container_count(endpoint->channel_ids);
- snapshot = ao2_alloc(
+ snapshot = ao2_alloc_options(
sizeof(*snapshot) + channel_count * sizeof(char *),
- endpoint_snapshot_dtor);
+ endpoint_snapshot_dtor,
+ AO2_ALLOC_OPT_LOCK_NOLOCK);
if (ast_string_field_init(snapshot, 80) != 0) {
return NULL;