Inlining may also depend on the processor you are compiling for, the more available registers there is, the more efficient it is to inline functions.
Also, how good the optimizer is. Even relatively recent versions of GCC seem to have a hard time understanding how, for example, to turn register access functions into single ARM instructions ... unless you hit them over the head with an inline annotation. I've shrunk drivers' I-space footprint from between ten and twenty percent, in some cases, by simple tricks like that.
Contrariwise, sometimes discrete copies of functions are better.
GCC isn't actually known for good inlining, and something that works well on x86 (or, one particular flavor of x86) will sometimes really hurt other processors.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds