Monday, November 23, 2020

Things to know about inline function

Below are some good points about inline function to keep in mind.

  1. Usage of inlne funcation , May increase function size so that it may not fit on the cache, causing lots of cahce miss.
  2. You can not use static variable in Inline funcation. If you use them then compiler will not treat this as inline funcation.
  3. You can not use recursion with inline funcation
  4. If funcation return value depends on any used loop, swicth or goto statement in your funcation then compiler will not treat this as inline funcation
Using inline will help, Just to save execuatation time by avoiding call/stack of funcation

inline funcation are good than macro becuase, macro does not perform any type checking/usual error checking while compilation.  

Macro are like find and replace while preprocessing steps. 


No comments:

Post a Comment