Reputation: 1569
Can tell somebody what this mean in C++? (is in front of a function) Also how I find something about this issue.
__attribute__ ((noinline))
Thank you . Regards
Upvotes: 2
Views: 8881
Reputation:
Pretty much what the name of this attribute implies. As a kind of heavy optimization, the compiler may chose to inline smaller functions in order to avoid the overhead of function calls. If you don't want your function to be inlined for some reason, you can use this nonstandard attribute to prevent the compiler from doing this optimization.
It is in front of a function
To learn how GCC attributes are organized syntactically, see this guide.
Upvotes: 1
Reputation: 400434
GCC defines a number of different non-standard function attributes used for indicating special features of functions. These are usually used for optimization or dealing with platform-specific features.
In this case, the noinline
attribute means "don't inline this function under any circumstances", when the optimizer might otherwise inline it.
Upvotes: 3