Home > Back-end >  When was the inline function is launched
When was the inline function is launched

Time:09-18

Four steps as pretreatment to compile assembly link, for example,
Macro function/macro definition of replacement is occurred in the pretreatment, and inline functions are not, I check it on the website, the compiler will be selective,
So when the compiler an inline function, is it in the link in this step?
The inline function at this time, if the inline function is defined in other header files, then call to come over, also need to link to other files,
I know that the ordinary function call overhead, what is assembly will see into the stack, so when an inline function in the links replacement, will not have this kind of operation?

There is a problem, average function not replaced, here is the code to run when this function is called, then the equivalent of just the link stage a symbol table, in the use of time to have this function. O is looking for?

CodePudding user response:

Compile time is opened, just like the macro expansion, only the inline function expansion will do parameter examination of what,

CodePudding user response:

Inline function and macro definition distinction
(1) the inline function at compile time, macro in the precompiled;
(2) the inline function directly embedded into the target code, the macro is simple to do textual substitution;
(3) the inline function type testing, grammatical judgment, and other functions, and the macro is not;
(4) the inline function is the function that the macro is not;
(5) when the macro definition should pay attention to writing (parameters to enclosed) or prone to ambiguity, inline function does not produce ambiguity;
  • Related