[Asterisk-code-review] force inline: remove all force inline from asterisk. (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Wed Feb 20 17:51:17 CST 2019


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/10936 )

Change subject: force_inline: remove all force_inline from asterisk.
......................................................................


Patch Set 4:

(4 comments)

https://gerrit.asterisk.org/#/c/10936/4/include/asterisk/strings.h
File include/asterisk/strings.h:

https://gerrit.asterisk.org/#/c/10936/4/include/asterisk/strings.h@a94
PS4, Line 94: 
I wonder why these force_inline functions were not using the AST_INLINE_API like many of the other functions in this header.


https://gerrit.asterisk.org/#/c/10936/4/include/asterisk/strings.h@1116
PS4, Line 1116: int attribute_pure ast_str_hash_restrict(unsigned int hash);
This one should be left as a simple inline instead of force_inline.  The function is so trivial that it is worth inlining.


https://gerrit.asterisk.org/#/c/10936/4/include/asterisk/utils.h
File include/asterisk/utils.h:

https://gerrit.asterisk.org/#/c/10936/4/include/asterisk/utils.h@a339
PS4, Line 339: 
I wonder why these were not declared using AST_INLINE_API() when originally created.


https://gerrit.asterisk.org/#/c/10936/4/include/asterisk/utils.h@a588
PS4, Line 588: 
             : 
             : 
             : 
             : 
             : 
> I wonder if this could be turned into a macro instead defined by ast_assert?
Yes, this should be made into a macro.    The compiler can really optimize the assertions and we shouldn't have them slow things down too much.  Also the value of __builtin_expect() can be taken advantage of by the compiler when it is inlined.



-- 
To view, visit https://gerrit.asterisk.org/10936
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2a90249763a7139fd12c54ad4e0e8d5cbbed14f9
Gerrit-Change-Number: 10936
Gerrit-PatchSet: 4
Gerrit-Owner: Chris Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: Chris Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Friendly Automation (1000185)
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua C. Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Walter Doekes <walter+asterisk at wjd.nu>
Gerrit-Comment-Date: Wed, 20 Feb 2019 23:51:17 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190220/148792ba/attachment.html>


More information about the asterisk-code-review mailing list