Inline Function Support Keyword (Inline) - Analog Devices VISUALDSP++ 3.5 Manual

C/c++ compiler and library for adsp-219x processors
Hide thumbs Also See for VISUALDSP++ 3.5:
Table of Contents

Advertisement

C/C++ Compiler Language Extensions

Inline Function Support Keyword (inline)

The
keyword directs
inline
you declare as
and the
inline
vides it as a C extension. Using this keyword eliminates the function-call
overhead and therefore can increase the speed of your program's execu-
tion. Argument values that are constant and that have known values may
permit simplifications at compile time.
The following example shows a function definition that uses the
keyword.
inline int max3 (int a, int b int c) {
return max (a, max(b, c));
}
A function declared
in every file in which the function is used. The normal way to do this is to
place the inline definition in a header file. Usually, it will also be declared
static.
In some cases, the compiler does not output object code for the function;
for example, the address is not needed for an
from within the defining program. However, recursive calls, and functions
whose addresses are explicitly referred to by the program, are compiled to
assembly code.
The compiler only inlines functions, even those declared using the
inline keyword, when optimizations are enabled (using the
switches, as described
1-62
cc219x
into the code of its callers. Inline function support
inline
keyword is a standard feature of C++; the compiler pro-
must be defined (its body must be included)
inline
on page
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
to integrate the code for the function
function called only
inline
1-37).
for ADSP-219x DSPs
inline
-O

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Related Products for Analog Devices VISUALDSP++ 3.5

Table of Contents