Can I inline a function partially/selectively?
c, c99, inline
Solution
You are completely at the mercy of the compiler with inlining. Leave aside partially, whether or not to `inline` a function is solely a decision that is best made by the compiler and you should rely on it to make the best decision.
Problem
``` void run_hot(void) { // I am called very often! serve(); // <more code here> } void run_cold(void) { // I am called only occasionally! serve(); // <more code here> } ???inline??? void serve(void) { // I only want to be called inline from hot functions! // <more code here> } ``` Is there any way to explicitly inline a function A in a function B while explicitly not inlining the same function A in a function C? Or am I completely at the mercy of my compiler?