another location to execute the code and then jump back. Inline functions thus run a little
faster than regular functions, but they come with a memory penalty. If a program calls an inline
function at 10 separate locations, then the program winds up with 10 copies of the function
inserted into the code.
If the time needed to execute the function
code is long compared to the time needed to handle the function call mechanism, then
the time saved is a relatively small portion of the entire process. If the code execution time is
short, then an inline call can save a large portion of the time used by the non-inline call. On
the other hand, you are now saving a large portion of a relatively quick process, so the
absolute time savings may not be that great unless the function is called frequently.
Suggest that if you have
been using C macros to perform function-like services, you should consider converting them to C++
inline functions.
In other words, the inline could implement anything that the c macro could implement.