Is the compiler just ignoring it?
Most probably, yes. It could be doing that for two reasons:
- You're compiling in debug mode. In debug mode all
inline
keywords are ignored to facilitate debugging. - It's ignoring it because the function is far too long for an inline function, and uses far too much stack space to safely inline, and is only invoked once. The
inline
keyword is a compiler HINT, not a mandatory requirement. It's the programmer's way of recommending the compiler to inline the function, just like a compiler in release mode will frequently inline functions on its own to increase performance. If it only sees negative value it won't comply.
Also, given the single invocation, it's highly unlikely that you'll even see differences no matter if it works or not. A single native function call is much easier on the CPU than a single task switch at the OS level.