[asterisk-commits] file: branch 13 r432742 - /branches/13/main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Mar 10 18:09:21 CDT 2015
Author: file
Date: Tue Mar 10 18:09:17 2015
New Revision: 432742
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432742
Log:
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/
Modified:
branches/13/main/endpoints.c
branches/13/main/stasis_bridges.c
branches/13/main/stasis_channels.c
Modified: branches/13/main/endpoints.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/endpoints.c?view=diff&rev=432742&r1=432741&r2=432742
==============================================================================
--- branches/13/main/endpoints.c (original)
+++ branches/13/main/endpoints.c Tue Mar 10 18:09:17 2015
@@ -467,9 +467,10 @@
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;
Modified: branches/13/main/stasis_bridges.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/stasis_bridges.c?view=diff&rev=432742&r1=432741&r2=432742
==============================================================================
--- branches/13/main/stasis_bridges.c (original)
+++ branches/13/main/stasis_bridges.c Tue Mar 10 18:09:17 2015
@@ -232,7 +232,8 @@
RAII_VAR(struct ast_bridge_snapshot *, snapshot, NULL, ao2_cleanup);
struct ast_bridge_channel *bridge_channel;
- snapshot = ao2_alloc(sizeof(*snapshot), bridge_snapshot_dtor);
+ snapshot = ao2_alloc_options(sizeof(*snapshot), bridge_snapshot_dtor,
+ AO2_ALLOC_OPT_LOCK_NOLOCK);
if (!snapshot || ast_string_field_init(snapshot, 128)) {
return NULL;
}
Modified: branches/13/main/stasis_channels.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/stasis_channels.c?view=diff&rev=432742&r1=432741&r2=432742
==============================================================================
--- branches/13/main/stasis_channels.c (original)
+++ branches/13/main/stasis_channels.c Tue Mar 10 18:09:17 2015
@@ -209,7 +209,8 @@
return NULL;
}
- snapshot = ao2_alloc(sizeof(*snapshot), channel_snapshot_dtor);
+ snapshot = ao2_alloc_options(sizeof(*snapshot), channel_snapshot_dtor,
+ AO2_ALLOC_OPT_LOCK_NOLOCK);
if (!snapshot || ast_string_field_init(snapshot, 1024)) {
ao2_cleanup(snapshot);
return NULL;
@@ -617,7 +618,8 @@
return;
}
- role_snapshot = ao2_alloc(sizeof(*role_snapshot) + role_len, channel_role_snapshot_dtor);
+ role_snapshot = ao2_alloc_options(sizeof(*role_snapshot) + role_len, channel_role_snapshot_dtor,
+ AO2_ALLOC_OPT_LOCK_NOLOCK);
if (!role_snapshot) {
return;
}
More information about the asterisk-commits
mailing list