the following appears to be invalid:
#if INLINE_BARRICADE
@inline(never)
#endif
static func
...
is there a way to conditionally insert these @inline(never) attributes based on a compilation flag?
michelf
(Michel Fortin)
2
A bit contorted, but I assume this would work:
#if INLINE_BARRICADE
@inline(never)
func foo() { _foo() }
#else
func foo() { _foo() }
#endif
@inline(__always)
private func _foo() {
print("foo!")
}
1 Like
mickeyl
(Dr. Mickey Lauer)
3
Somewhat offtopic, but in which cases would you want to forbid inlining?
for performance profiling. the compiler is so aggressive it tends to turn the whole app into two or three stack frames, which is useless for profiling
1 Like
ahti
(Lukas Stabe 🙃)
5
Is profiling a version of the binary with different/inhibited optimizations and thus different performance characteristics much more useful?
2 Likes