R
Hmm, aber hier steht
MSDN Library Suche: __clrcall
Specifies that a function can only be called from managed code.
Use __clrcall for all virtual functions that will only be called from managed code.
However this calling convention cannot be used for functions that will be called from native code.
Use __clrcall to improve performance when calling from a managed function
to a virtual managed function or from managed function to managed function through pointer.
Entry points are separate, compiler-generated functions.
If a function has both native and managed entry points,
one of them will be the actual function with the function implementation.
The other function will be a separate function (a thunk) that calls into the actual function
and lets the common language runtime perform PInvoke.
When marking a function as __clrcall, you indicate the function implementation must be MSIL
and that the native entry point function will not be generated.
Also, ich verstehe das so, dass ich mit __clrcall den "managed entry" erzwinge
und damit die Leistungsabfall, den du in deinem Blog ansprichst, zumindest teilweise abbaue.
Irgendwo habe ich gelesen, dass die Übersetzung in CIL/MSIL immer mit
(meistens geringen) Leistungsverlusten einhergeht,
das mit Hinblick auf Portabilität aber in Kauf genommen wird.
Ich wollte jetzt so programmieren, dass ich zwischen beiden hin- und herschalten kann,
wie in dem Makro angedeutet. Halte ich nicht unbedingt für ne schlechte Idee
Falls noch jemand seinen Senf dazugeben will, immer her damit,
ich lern gern dazu.
Alles Gute
Rahul