inline dont work in VC++
-
I have a simple qestion that when we make a function inline then the code should be embeddede in the main function and we should not have any call done to the function . But actully in VC++ this dont happen pls try the example , and let me know that if am missing to set any compiler flag . In VC++ __forceinline is used to force inline function by passing the cost/benefit analysis .I have tried that also but it dont work . To test the code just go to the disassembly and if u find any assembly instruction as "call" then the inline mechanism is not implement by ur vc compiler . Thank you Vikas Amin Embin Technology Bombay vikas.amin@embin.com
-
I have a simple qestion that when we make a function inline then the code should be embeddede in the main function and we should not have any call done to the function . But actully in VC++ this dont happen pls try the example , and let me know that if am missing to set any compiler flag . In VC++ __forceinline is used to force inline function by passing the cost/benefit analysis .I have tried that also but it dont work . To test the code just go to the disassembly and if u find any assembly instruction as "call" then the inline mechanism is not implement by ur vc compiler . Thank you Vikas Amin Embin Technology Bombay vikas.amin@embin.com
what a C++ question do in a hardware forum Mr Amin ??? did you lost yourself into this deep deep dark website !? :omg: moreover, ,if i well remember,, this is a repost... maybe that's why you asked it here (to hope me not to see it ;P but you missed it ;) )
TOXCCT >>> GEII power
[toxcct][VisualCalc] -- modified at 6:15 Wednesday 30th November, 2005 -
I have a simple qestion that when we make a function inline then the code should be embeddede in the main function and we should not have any call done to the function . But actully in VC++ this dont happen pls try the example , and let me know that if am missing to set any compiler flag . In VC++ __forceinline is used to force inline function by passing the cost/benefit analysis .I have tried that also but it dont work . To test the code just go to the disassembly and if u find any assembly instruction as "call" then the inline mechanism is not implement by ur vc compiler . Thank you Vikas Amin Embin Technology Bombay vikas.amin@embin.com
-
I have a simple qestion that when we make a function inline then the code should be embeddede in the main function and we should not have any call done to the function . But actully in VC++ this dont happen pls try the example , and let me know that if am missing to set any compiler flag . In VC++ __forceinline is used to force inline function by passing the cost/benefit analysis .I have tried that also but it dont work . To test the code just go to the disassembly and if u find any assembly instruction as "call" then the inline mechanism is not implement by ur vc compiler . Thank you Vikas Amin Embin Technology Bombay vikas.amin@embin.com
Vikas [[]]: There are several reasons for that: 1) VC++ does not inline functions implemented in a diferent module from its declaration (at least for classes, the rest i don´t know). See this http://www.codecomments.com/archive292-2004-11-329446.html 2) Functions containing while cycles will not expand inline 3) Functions calling inline functions will not expand inline I think that´s all. Peace [[]] hint_54