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
ZCan I force a function to NEVER be inlined?
Z>
ZI want the call stack returned by:
ZSystem.Diagnostics.StackTrace callStack = new
ZSystem.Diagnostics.StackTrace();
Zto be such that:
ZSystem.Diagnostics.StackFrame frame = callStack.GetFrame(0);
Zis the function itself, NOT the function's caller (due to a release
Zbuild making the function inlined into its caller)!
Zthanks!
Z>
ZZytan
Z>