svSetScope question

let’s assume the import “DPI-C” context function foo is declared in module A while export “DPI-C” function bar is defined in module B. And function foo is defined as follows:


void foo()
{
   svScope scope_a = svGetScope();
   svSetScope(svGetScopeFromName("module_b"));
   bar();
   svSetScope(scope_a);
}

The question is, is svScope save and restore for module A necessary?

In reply to robert.liu:

No. The scope is only used to search for the right context for the export if different from the import context.

In reply to dave_59:

Thanks Dave. That make sense.