<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/3576/">https://reviewboard.asterisk.org/r/3576/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On June 4th, 2014, 3:47 p.m. MDT, <b>rmudgett</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/3576/diff/2/?file=59055#file59055line30" style="color: black; font-weight: bold; text-decoration: underline;">branches/12/main/astobj2.c</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">30</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">ASTERISK_FILE_VERSION</span><span class="p">(</span><span class="n">__FILE__</span><span class="p">,</span> <span class="s">"$Revision$"</span><span class="p">)</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">30</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">ASTERISK_FILE_VERSION</span><span class="p">(</span><span class="n">__FILE__</span><span class="p">,</span> <span class="s">"$Revision$"</span><span class="p">)</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Drat!  Splitting astobj2 makes the utils directory no longer compile.  That's going to suck a bit getting those hacked up utilities to compile again.
</pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Just had to update the utils/Makefile to include copying the new files.

Also to get refcounter to compile without complaining, I had to remove the force of no optimization.  This problem has existed for me for a while.</pre>
<br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On June 4th, 2014, 3:47 p.m. MDT, <b>rmudgett</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/3576/diff/2/?file=59061#file59061line2002" style="color: black; font-weight: bold; text-decoration: underline;">branches/12/tests/test_astobj2.c</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">2002</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb">   </span><span class="n">ast_test_status_update</span><span class="p">(</span><span class="n">test</span><span class="p">,</span> <span class="s">"%dK traversals, %9s : %5lu ms</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">2003</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb">   </span><span class="tb">  </span><span class="n">ITERATIONS</span> <span class="o">/</span> <span class="mi">1000</span><span class="p">,</span> <span class="n">test_container2str</span><span class="p">(</span><span class="n">type</span><span class="p">),</span> <span class="n">ast_tvdiff_ms</span><span class="p">(</span><span class="n">ast_tvnow</span><span class="p">(),</span> <span class="n">start</span><span class="p">));</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Compiler error: ast_tvdiff_ms(ast_tvnow(), start) does not match the format string.  ast_tvdiff_ms() returns int64_t.  Probably best to cast it to (unsigned long).</pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">No error for me but I added the cast.</pre>
<br />




<p>- George</p>


<br />
<p>On June 4th, 2014, 7:33 p.m. MDT, George Joseph wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers and rmudgett.</div>
<div>By George Joseph.</div>


<p style="color: grey;"><i>Updated June 4, 2014, 7:33 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">In preparation for weak-reference containers, and because it makes the existing code easier to read and maintain, I've split the astobj2 common structure and enum definitions and prototypes into astobj2_private.h, the hash table implementation into astobj2_hash.c, and the rbtree implementation into astobj2_rbtree.c.  All of the public functions remain in astobj2.c.

A few functions (adjust_lock, container_destruct, container_destruct_debug) needed to have their static modifiers removed so they'd be visible from the other object files but other than that there were NO functional changes, no logic changes, etc.  

EDIT:..
Also added a basic test to the test framework to monitor performance impacts as changes are made to astobj2.
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I used both the test framework and the test suite.  For the test suite, I used channels/pjsip since that exercises sorcery significantly and that in turn exercises astobj2.

All tests that worked before the change worked after the change.

Before...

Test Framework
393 Test(s) Executed  393 Passed  0 Failed

Test Suite
tests/channels/pjsip/
        Tests: 88               Passed: 87              Failed: 1
FAILED: tests/channels/pjsip/dialplan_functions/pjsip_endpoint

After...

Test Framework
393 Test(s) Executed  393 Passed  0 Failed

Test Suite
tests/channels/pjsip/
        Tests: 88               Passed: 87              Failed: 1
FAILED: tests/channels/pjsip/dialplan_functions/pjsip_endpoint

Not sure why the pjsip_endpoint function is failing but it's not this patch's fault.
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>branches/12/utils/Makefile <span style="color: grey">(415187)</span></li>

 <li>branches/12/tests/test_astobj2.c <span style="color: grey">(415187)</span></li>

 <li>branches/12/main/astobj2_rbtree.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/main/astobj2_private.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/main/astobj2_hash.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/main/astobj2_container_private.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/main/astobj2_container.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/main/astobj2.c <span style="color: grey">(415187)</span></li>

 <li>branches/12/include/asterisk/astobj2.h <span style="color: grey">(415187)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/3576/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>