<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10393">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">core: Disable astobj2 locking for some common objects.<br><br>* ACO options<br>* Indications<br>* Module loader ref_debug object<br>* Media index info and variants<br>* xmldoc items<br><br>These allocation locations were identified using reflocks.py on the<br>master branch.<br><br>Change-Id: Ie999b9941760be3d1946cdb6e30cb85fd97504d8<br>---<br>M main/config_options.c<br>M main/indications.c<br>M main/loader.c<br>M main/media_index.c<br>M main/xmldoc.c<br>5 files changed, 17 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/93/10393/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/config_options.c b/main/config_options.c</span><br><span>index c78f95d..f8b2be8 100644</span><br><span>--- a/main/config_options.c</span><br><span>+++ b/main/config_options.c</span><br><span>@@ -224,7 +224,8 @@</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (!(opt = ao2_alloc(sizeof(*opt), config_option_destroy))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ opt = ao2_alloc_options(sizeof(*opt), config_option_destroy, AO2_ALLOC_OPT_LOCK_NOLOCK);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!opt) {</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span>@@ -315,7 +316,9 @@</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (!(opt = ao2_alloc(sizeof(*opt) + argc * sizeof(opt->args[0]), config_option_destroy))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ opt = ao2_alloc_options(sizeof(*opt) + argc * sizeof(opt->args[0]),</span><br><span style="color: hsl(120, 100%, 40%);">+ config_option_destroy, AO2_ALLOC_OPT_LOCK_NOLOCK);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!opt) {</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span>diff --git a/main/indications.c b/main/indications.c</span><br><span>index 13e968f..e0ba59b 100644</span><br><span>--- a/main/indications.c</span><br><span>+++ b/main/indications.c</span><br><span>@@ -604,7 +604,9 @@</span><br><span> }</span><br><span> AST_LIST_TRAVERSE_SAFE_END;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (!(ts = ao2_alloc(sizeof(*ts), ast_tone_zone_sound_destructor))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ts = ao2_alloc_options(sizeof(*ts), ast_tone_zone_sound_destructor,</span><br><span style="color: hsl(120, 100%, 40%);">+ AO2_ALLOC_OPT_LOCK_NOLOCK);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!ts) {</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span>diff --git a/main/loader.c b/main/loader.c</span><br><span>index 30a9832..3ac0ad5 100644</span><br><span>--- a/main/loader.c</span><br><span>+++ b/main/loader.c</span><br><span>@@ -235,7 +235,7 @@</span><br><span> </span><br><span> mod->info = info;</span><br><span> #ifdef REF_DEBUG</span><br><span style="color: hsl(0, 100%, 40%);">- mod->ref_debug = ao2_t_alloc(0, NULL, info->name);</span><br><span style="color: hsl(120, 100%, 40%);">+ mod->ref_debug = ao2_t_alloc_options(0, NULL, AO2_ALLOC_OPT_LOCK_NOLOCK, info->name);</span><br><span> #endif</span><br><span> AST_LIST_HEAD_INIT(&mod->users);</span><br><span> </span><br><span>diff --git a/main/media_index.c b/main/media_index.c</span><br><span>index 72bc1cc..bfaa580 100644</span><br><span>--- a/main/media_index.c</span><br><span>+++ b/main/media_index.c</span><br><span>@@ -64,7 +64,8 @@</span><br><span> size_t str_sz = strlen(variant_str) + 1;</span><br><span> struct media_variant *variant;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- variant = ao2_alloc(sizeof(*variant) + str_sz, media_variant_destroy);</span><br><span style="color: hsl(120, 100%, 40%);">+ variant = ao2_alloc_options(sizeof(*variant) + str_sz, media_variant_destroy,</span><br><span style="color: hsl(120, 100%, 40%);">+ AO2_ALLOC_OPT_LOCK_NOLOCK);</span><br><span> if (!variant) {</span><br><span> return NULL;</span><br><span> }</span><br><span>@@ -110,8 +111,10 @@</span><br><span> static struct media_info *media_info_alloc(const char *name)</span><br><span> {</span><br><span> size_t name_sz = strlen(name) + 1;</span><br><span style="color: hsl(0, 100%, 40%);">- struct media_info *info = ao2_alloc(sizeof(*info) + name_sz, media_info_destroy);</span><br><span style="color: hsl(120, 100%, 40%);">+ struct media_info *info;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ info = ao2_alloc_options(sizeof(*info) + name_sz, media_info_destroy,</span><br><span style="color: hsl(120, 100%, 40%);">+ AO2_ALLOC_OPT_LOCK_NOLOCK);</span><br><span> if (!info) {</span><br><span> return NULL;</span><br><span> }</span><br><span>diff --git a/main/xmldoc.c b/main/xmldoc.c</span><br><span>index d242453..37b2861 100644</span><br><span>--- a/main/xmldoc.c</span><br><span>+++ b/main/xmldoc.c</span><br><span>@@ -2292,7 +2292,9 @@</span><br><span> {</span><br><span> struct ast_xml_doc_item *item;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (!(item = ao2_alloc(sizeof(*item), ast_xml_doc_item_destructor))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ item = ao2_alloc_options(sizeof(*item), ast_xml_doc_item_destructor,</span><br><span style="color: hsl(120, 100%, 40%);">+ AO2_ALLOC_OPT_LOCK_NOLOCK);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!item) {</span><br><span> ast_log(AST_LOG_ERROR, "Failed to allocate memory for ast_xml_doc_item instance\n");</span><br><span> return NULL;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10393">change 10393</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10393"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ie999b9941760be3d1946cdb6e30cb85fd97504d8 </div>
<div style="display:none"> Gerrit-Change-Number: 10393 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>