Original Post
🔒 Locked
What does inline Do....
Advertisement
Inlining a function simply plugs the function code into your code where you called the function (just like a macro, it replaces the function call, with the code). People inline functions in order to get speed, since the stack frame slows down things quite a bit. (If you don''t know what a stack frame is, just keep in mind that it''s slower than an inlined function
)
..-=gLaDiAtOr=-..
..-=gLaDiAtOr=-..
Everything said so far is fine, but remember using inline is a suggestion to the compiler. A variety of things will make the compiler ignore your suggestion. There is a cost/benefit analysis done as part of this determination. Recursive functions will not actually be inline. Even with Microsquishies'' _forceinline key word not every function will be inlined.
I''ve always heard (and generally followed) the rule that you don''t inline functions as you design/code. Inline them later when its time for optimization.
Mike Roberts
aka milo
mlbobs@telocity.com
I''ve always heard (and generally followed) the rule that you don''t inline functions as you design/code. Inline them later when its time for optimization.
Mike Roberts
aka milo
mlbobs@telocity.com
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement