The #pragma isolated_call directive lists functions that do not alter data objects visible at the time of the function call.
The pragma must appear before calls to the functions in the identifier list. The identifiers listed must be declared before they are used in the pragma, and must be of type function or a typedef of function.
If a name refers to an overloaded function, all variants of that function are marked as isolated calls.
The pragma informs the compiler that none of the functions listed has side effects. Functions are cosidered to have side effects if they:
Any change in the state of the runtime environment is considered a side effect. Passing function arguments by reference is one side effect that is allowed, but in general, functions with side effects can give incorrect results when listed in #pragma isolated_call directives.
Marking a function as isolated indicates to the optimizer that external and static variables cannot be changed by the called function, and that references to storage can be deleted from the calling function where appropriate. Instructions can be reordered with more freedom, resulting in fewer pipeline delays and faster execution in the processor.
Note that instruction reordering might yield code with more values in general purpose and/or floating-point registers maintained across the isolated call. When the isolated call is not located in a loop, the overhead of saving and restoring extra registers might not be worth the savings that result from deleting the storage references.
Functions specified in the identifier are permitted to examine external objects and return results that depend on the state of the runtime environment. The functions can also modify the storage pointed to by any pointer arguments passed on to the function, that is, calls by reference. Do not specify a function that calls itself or relies on local static storage. Listing such functions in the #pragma isolated_call directive can give unpredictable results.
The -qisolated_call compiler option has the same effect as this pragma. The -qignprag compiler option causes aliasing programs to be ignored. Use this option to debug applications containing the #pragma isolated_call directive.
Example of the
#pragma isolated_call Preprocessor Directive
#pragma Preprocessor
Directives
List of Preprocessor
Directives