Thursday, April 22, 2010

Preventing method inlining in c#

I sometimes want to prevent inlining of methods byt the JIT in C#. Usually this is because I need the call stack to be preserved, for example when using Assembly.GetCallingAssembly.

This is the attribute:
[MethodImpl(MethodImplOptions.NoInlining)]

0 comments:

Post a Comment