I would like to be as close to real time as possible, so my intention is to have the most critical part of the code unmanaged (I don’t want GC to block execution). So I tried this:
class Native
{
public:
int GetValue()
{
return 1;
}
};
ref class Managed
{
public:
void Test()
{
Native n;
Console::WriteLine(n.GetValue());
}
};
ILDASM shows Native::GetValue compiled to IL. Is it possible to keep this class/function unmanaged? Is a dedicated unmanaged dll the only way to do it?
It looks like I need #pragma directives: