Oracle® Database PL/SQL Language Reference 11g Release 2 (11.2) Part Number E10472-05 |
|
|
View PDF |
The INLINE
pragma specifies that a subprogram call is, or is not, to be inlined. Inlining replaces a subprogram call (to a subprogram in the same program unit) with a copy of the called subprogram.
Topics:
Syntax
inline_pragma ::=
Semantics
identifier
The name of a subprogram.
YES
If PLSQL_OPTIMIZE_LEVEL=2
, 'YES'
specifies that the subprogram call is to be inlined.
If PLSQL_OPTIMIZE_LEVEL=3
, 'YES'
specifies that the subprogram call has a high priority for inlining.
NO
Specifies that the subprogram call is not to be inlined.
Usage
The INLINE
pragma affects only the immediately following declaration or statement, and only some kinds of statements.
When the INLINE
pragma immediately precedes one of these statements, the pragma affects every call to the specified subprogram in that statement (see Example 12-1):
Assignment
Call
Conditional
CASE
CONTINUE
WHEN
EXECUTE
IMMEDIATE
EXIT
WHEN
LOOP
RETURN
The INLINE
pragma does not affect statements that are not in the preceding list.
When the INLINE
pragma immediately precedes a declaration, it affects:
Every call to the specified subprogram in that declaration
Every initialization value in that declaration except the default initialization values of records
If the name of the subprogram (identifier
) is overloaded (that is, if it belongs to multiple subprograms), the INLINE
pragma applies to every subprogram with that name (see Example 12-2). For information about overloaded subprogram names, see "Overloaded Subprograms".
The PRAGMA
INLINE
(
identifier,
'YES')
very strongly encourages the compiler to inline a particular call, but the compiler might not to do so if other considerations or limits make the inlining undesirable. If you specify PRAGMA INLINE (
identifier,
'NO')
, the compiler does not inline calls to subprograms named identifier
(see Example 12-3).
Multiple pragmas can affect the same declaration or statement. Each pragma applies its own effect to the statement. If PRAGMA
INLINE(
identifier,
'YES')
and PRAGMA INLINE (
identifier,
'NO')
have the same identifier
, 'NO'
overrides 'YES'
(see Example 12-4). One PRAGMA INLINE (
identifier,
'NO')
overrides any number of occurrences of PRAGMA INLINE (
identifier,
'YES')
, and the order of these pragmas is not important.
Examples
Example 12-1, "Specifying that a Subprogram Is To Be Inlined"
Example 12-2, "Specifying that an Overloaded Subprogram Is To Be Inlined"
Example 12-3, "Specifying that a Subprogram Is Not To Be Inlined"
Example 12-4, "Applying Two INLINE Pragmas to the Same Subprogram"
Related Topics