Why use macros to define functions

In a C program, macro code can be used to improve execution efficiency. The macro code itself is not a function, but is used like a function.
The preprocessor replaces the function call by copying the macro code, which saves the 
process of pushing parameters on the stack, generating CALL calls in assembly language, returning parameters, and executing return, thereby improving the speed. 
The biggest disadvantage of using macro code is that it is error-prone, and the preprocessor often produces unexpected side effects when copying macro code.

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324179272&siteId=291194637