[asterisk-commits] file: trunk r432743 - in /trunk: ./ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Mar 10 18:09:51 CDT 2015
Author: file
Date: Tue Mar 10 18:09:49 2015
New Revision: 432743
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432743
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/
........
Merged revisions 432742 from http://svn.asterisk.org/svn/asterisk/branches/13
Modified:
trunk/ (props changed)
trunk/main/endpoints.c
trunk/main/stasis_bridges.c
trunk/main/stasis_channels.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.
Modified: trunk/main/endpoints.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/endpoints.c?view=diff&rev=432743&r1=432742&r2=432743
==============================================================================
--- trunk/main/endpoints.c (original)
+++ trunk/main/endpoints.c Tue Mar 10 18:09:49 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: trunk/main/stasis_bridges.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stasis_bridges.c?view=diff&rev=432743&r1=432742&r2=432743
==============================================================================
--- trunk/main/stasis_bridges.c (original)
+++ trunk/main/stasis_bridges.c Tue Mar 10 18:09:49 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: trunk/main/stasis_channels.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stasis_channels.c?view=diff&rev=432743&r1=432742&r2=432743
==============================================================================
--- trunk/main/stasis_channels.c (original)
+++ trunk/main/stasis_channels.c Tue Mar 10 18:09:49 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