[asterisk-dev] [Code Review] 3756: refcounter.py: use delta's to track current reference count, treat **destroyed** as just another "-1", partially fix a race condition in astobj2

rmudgett reviewboard at asterisk.org
Sat Jul 12 01:33:20 CDT 2014


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



/branches/1.8/main/astobj2.c
<https://reviewboard.asterisk.org/r/3756/#comment22873>

    Rename to old_refcount or something like that.  res just isn't very descriptive of what the value means.



/branches/1.8/main/astobj2.c
<https://reviewboard.asterisk.org/r/3756/#comment22872>

    Hmm.  If delta is zero we shouldn't be logging it since the caller just wants the number of current references and not to change it.


- rmudgett


On July 12, 2014, 1:13 a.m., Corey Farrell wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3756/
> -----------------------------------------------------------
> 
> (Updated July 12, 2014, 1:13 a.m.)
> 
> 
> Review request for Asterisk Developers and Matt Jordan.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This incorporates the ideas from r3572, with an improvement.  REF_DEBUG is still effective when ao2_ref(obj, -1) is run on an object that is already destroyed.
> 
> In addition refcounter.py is updated to use delta's to track the current reference count.  This works around a race condition where **destroyed** could be printed before the unref from 2.
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/main/astobj2.c 417500 
>   /branches/1.8/contrib/scripts/refcounter.py 417486 
> 
> Diff: https://reviewboard.asterisk.org/r/3756/diff/
> 
> 
> Testing
> -------
> 
> Verified that all false reported leaks are no longer.
> 
> One thing I noticed, the updated refcounter.py took 40 seconds to process a file when the same file was processed in 30 seconds before the change.  
> 
> 
> Thanks,
> 
> Corey Farrell
> 
>

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


More information about the asterisk-dev mailing list