Page 1 of 1

[NO REPLY] Inlining (rev #2, 2018-1-15)

Posted: Sun Dec 10, 2017 5:40 pm
by Giovanni
Restrictions, amendments and extensions:

  • The inline keyword is only allowed together with static. Non-static use shall results in an error.
  • The inline keyword enforces inlining rather than suggesting it. In no case an independent instance of an inline function is generated.
  • It is not possible to take a pointer of an inline function, trying results in an error.
  • An offline keyword will be introduced that forbids inlining for that function.
  • Functions that are not inline nor offline will be handled by the compiler for inlining decision.

Code: Select all

static inline void func1(void) {
  // This will surely be inlined.
}

offline void func2(void) {
  // This will surely not be inlined.
}