Original Post
Why is this code compiled as an independent function
not as ''inline'' instructions ?
__inline int fixMul (int a, int b)
{
__asm
{
xor edx, edx
mov eax, ' Target=_Blank>Link
quote:
inline
function_declarator; // C++ Specific
__inline
function_declarator;// Microsoft Specific
__forceinline
function_declarator;// Microsoft Specific
The inline and __inline keywords allow the compiler to insert a copy of the function body into each place the function is called. The insertion occurs only if the compiler's cost/benefit analysis show it to be profitable. The __forceinline keyword overrides the cost/benefit analysis and relies on the judgement of the programmer instead. Exercise caution when using __forceinline. Indiscriminate use of __forceinline can result in larger code with only marginal performance gains or, in some cases, even performance losses (due to increased paging of a larger executable, for example).
|
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more