Hello Zytan,
Just to add to Nicholas, another inlining prerequisites are:
- methods are small (32bytes of IL),
- no virtual,
- simple control flow
- no try/catch
- no stuct for arguments or local.
---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog:
http://spaces.live.com/laflour
Team blog:
http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Z> Can I force a function to NEVER be inlined?
Z>
Z> I want the call stack returned by:
Z> System.Diagnostics.StackTrace callStack = new
Z> System.Diagnostics.StackTrace();
Z> to be such that:
Z> System.Diagnostics.StackFrame frame = callStack.GetFrame(0);
Z> is the function itself, NOT the function's caller (due to a release
Z> build making the function inlined into its caller)!
Z> thanks!
Z>
Z> Zytan
Z>