c++.netdlljit

Is it possible to C++ compiler inline method calls across DLLs?


Is it possible to C++ compiler inline method calls across DLLs? Is it possible for .NET JIT ?


Solution

  • That's a definite Yes for a .NET jitter. It merely loads IL from a DLL, just-in-time code generation makes the fact that it came from a DLL disappear. All code from any DLL goes into the same loader heap. One consequence of this is that a DLL cannot be unloaded unless the entire AppDomain is unloaded.

    A definite No for the C++ compiler, the exported functions are precompiled and located at a fixed address, an offset from the DLL base address. An indirect jump through the IAT is required, although optimizations are possible. But not inlining, that has to be done by the compiler.