Originally posted by Weasel
View Post
Originally posted by Weasel
View Post
The insertion (called inline expansion or inlining) occurs only if the compiler's cost/benefit analysis show it to be profitable. Inline expansion alleviates the function-call overhead at the potential cost of larger code size.
This is the Microsoft one but I could just as simply quote the gcc or llvm ones the optimisation may discard all but 1 or if it makes a perform call that is faster inlined every point that is inline may be still there.
Also its not the linker that makes the inlining judgement call its the compiler. Yes Link Time Optimization in a linker the resend the object files back past the compiler optimisation engine. Now if you program is made from 1 object file the inline will be as solved as they are going to be when the object was made. So discards of inlines are done first in the object production stage then a second round of discards of inlines can happen again in the linking stage. But these discards do not say their will be only 1 copy left of inlines.
If you want only 1 copy you have to use a normal function this partly avoids the compiler code/benefit analysis doing something you are not expecting.
Originally posted by jacob
View Post
Like syscall open is a 1 to 1 match to the fcntl.h open in posix standard.
These 1 to 1 matches kind of blur the line. Of course nothing says glibc developers could not properly implement filter and auxiliary in versioned and pull kernel .so functions when it suits.
Comment