Example of #pragma isolated_call

The following example shows the use of the #pragma isolated_call directive. Because the function this_function does not have side effects, a call to it will not change the value of the external variable a. The compiler can assume that the argument to other_function has the value 6 and will not reload the variable from memory.

int a, this function(int);	//Assumed to have no side effects
#pragma isolated_call(this_function)
that_function()
{
	a = 6;
	this_function(7);	// Call does not change the value of "a"
	other_function(a);	// Argument "a" has the value 6
}

The isolated call compiler option has the same effect as this pragma. The ignprag compiler option causes aliasing pragmas to be ignored. Use this option to debug applications containing the #pragma isolated_call directive.



Preprocessor Directives - An Overview
Preprocessor Directive - #pragma


#pragma isolated_call