Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when does the compiler necessarily not make a function marked inline as inline

When does the compiler necessarily not make a function marked inline as inline?

like image 401
Nishanth Avatar asked Aug 15 '26 21:08

Nishanth


1 Answers

Most obviously it can't inline the function when you take a pointer to the function. If you pass around the pointer and (maybe later) decide to call the function through the pointer, the compiler has to generate a non-inlined version of the function. Of course if the function is called directly, the compiler might still inline it. And the compiler is also free to not inline the function anyways.

like image 134
Daniel Frey Avatar answered Aug 17 '26 10:08

Daniel Frey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!