I
InuY4sha
What do I gain from defining a [small] function as inline?
Thanks
R
Thanks
R
What do I gain from defining a [small] function as inline?
Thanks
R
What do I gain from defining a [small] function as inline?
Thanks
R
In case you haven't found the answer you were looking for, I'll give it
a shot:
Calling a function has a (small) amount of overhead to it: things
(i.e., return address and function arguments) need to be pushed and
popped off of the stack, and jumps need to be made to different points
in the program.
If a function is "sufficiently" small (only a few lines), then the
overhead of actually calling a function may become a significant
portion of the function's execution time.
By inline'ing the function, a copy of the functions body is compiled
in-place wherever it is called in the program, thus eliminating the
actual call during runtime, and *maybe* getting small performance
increase.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.