Am 02.04.20 um 00:39 schrieb Jason Craig:
That would be my choice, but I'm sure the developer is worried about performance and is trying to inline as much as possible.
In modern compilers, the "inline" keyword has no influence on inlining decisions. They have a simple cost/benefit model where the cost is basically the length of the function to be inlined, and the benefit is determined by the hotness of the execution path. If no profiling information is available, hotness is usually assumed to be constant, except that it's a bit higher in loops, and even higher in nested loops, and lower in paths that lead to exceptions or calls to noreturn functions like abort or exit. So removing the inline keyword doesn't change anything about inlining. Still, without LTO the definition must be available for inlining, although at least on openSUSE that's not a concern since LTO is enabled by default now. If you're really sure you want a function to be inlined which the compiler considers too long, you can still add non-standard attributes like __attribute__((always_inline)) to force it. You could also use __attribute__((hot)), but my impression is that compilers ignore it. Kind regards, Aaron -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org