[asterisk-dev] [Code Review] 3576: astobj2: Split hash and rbtree impls into their own source files.

George Joseph reviewboard at asterisk.org
Wed Jun 4 20:33:57 CDT 2014



> On June 4, 2014, 3:47 p.m., rmudgett wrote:
> > branches/12/tests/test_astobj2.c, lines 2002-2003
> > <https://reviewboard.asterisk.org/r/3576/diff/2/?file=59061#file59061line2002>
> >
> >     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).

No error for me but I added the cast.


> On June 4, 2014, 3:47 p.m., rmudgett wrote:
> > branches/12/main/astobj2.c, line 30
> > <https://reviewboard.asterisk.org/r/3576/diff/2/?file=59055#file59055line30>
> >
> >     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.
> >

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.


- George


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3576/#review12048
-----------------------------------------------------------


On June 4, 2014, 7:33 p.m., George Joseph wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3576/
> -----------------------------------------------------------
> 
> (Updated June 4, 2014, 7:33 p.m.)
> 
> 
> Review request for Asterisk Developers and rmudgett.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> 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.
> 
> 
> Diffs
> -----
> 
>   branches/12/utils/Makefile 415187 
>   branches/12/tests/test_astobj2.c 415187 
>   branches/12/main/astobj2_rbtree.c PRE-CREATION 
>   branches/12/main/astobj2_private.h PRE-CREATION 
>   branches/12/main/astobj2_hash.c PRE-CREATION 
>   branches/12/main/astobj2_container_private.h PRE-CREATION 
>   branches/12/main/astobj2_container.c PRE-CREATION 
>   branches/12/main/astobj2.c 415187 
>   branches/12/include/asterisk/astobj2.h 415187 
> 
> Diff: https://reviewboard.asterisk.org/r/3576/diff/
> 
> 
> Testing
> -------
> 
> 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.
> 
> 
> Thanks,
> 
> George Joseph
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140605/c916fa7f/attachment-0001.html>


More information about the asterisk-dev mailing list