coder.inline
Control inlining of current function in generated code
Description
coder.inline("always")
inlines the
body of the function in which it is used, directly into the calling locations in the
generated code.
The coder.inline("always")
directive does not support the inlining
of:
Entry-point functions
Recursive functions
Functions that contain
parfor
-loopsFunctions called from
parfor
-loops
coder.inline("never")
prevents
inlining of the function in which it is used in the generated code. Use the
coder.inline("never")
optimization directive when you want to simplify
the mapping between the MATLAB® source code and the generated code.
The coder.inline("never")
directive does not prevent the inlining of:
Empty functions
Functions that return constant output
To prevent inlining even in these situations, use the coder.ignoreConst
function on an input at the function call site in your
MATLAB code. For more information, see Resolve Issue: coder.inline("never") and coder.nonInlineCall Do Not Prevent Function Inlining.