[asterisk-dev] [Code Review] use __alignof__ instead of sizeof for alignment of ast_string_field_allocation

Kevin Fleming reviewboard at asterisk.org
Tue Nov 8 16:45:38 CST 2011


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

Ship it!


Looks good.


/branches/1.8/include/asterisk/stringfields.h
<https://reviewboard.asterisk.org/r/1573/#comment8920>

    This may be worth a comment (not caused by your changes... but since you are touching it).
    
    The math in this macro absolutely *depends* on 'x' being a "char *" (or a pointer to any other byte-sized type); the type of "*x" was anything larger, then its size would be multiplied by the __alignof__ value and stuff would break all over the place.



/branches/1.8/include/asterisk/utils.h
<https://reviewboard.asterisk.org/r/1573/#comment8921>

    This is no longer specific to integers.


- Kevin


On Nov. 8, 2011, 4:25 p.m., wdoekes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1573/
> -----------------------------------------------------------
> 
> (Updated Nov. 8, 2011, 4:25 p.m.)
> 
> 
> Review request for Asterisk Developers and Kevin Fleming.
> 
> 
> Summary
> -------
> 
> http://lists.digium.com/pipermail/asterisk-dev/2011-November/052174.html
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/include/asterisk/utils.h 343905 
>   /branches/1.8/main/utils.c 343905 
>   /branches/1.8/include/asterisk/stringfields.h 343905 
> 
> Diff: https://reviewboard.asterisk.org/r/1573/diff
> 
> 
> Testing
> -------
> 
> It compiles. The numbers are still a multiple of two.
> 
> 
> Thanks,
> 
> wdoekes
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20111108/56370df7/attachment-0001.htm>


More information about the asterisk-dev mailing list