__declspec( noinline ) inline int __cdecl  _AfxInitManaged()在afx.inl中75行,谁能给我解释一下,这个到底是是怎么一回事!既有noinline ,又有inline ???

解决方案 »

  1.   

    __declspec(noinline) tells the compiler to never inline a particular member function (function in a class).It may be worthwhile to not inline a function if it is small and not critical to the performance of your code. That is, if the function is small and not likely to be called often, such as a function that handles an error condition.Keep in mind that if a function is ed noinline, the calling function will be smaller and thus, itself a candidate for compiler inlining.
      

  2.   

    __declspec(noinline)通知编译器不要内联一个具体的成员函数(类中的函数);
    同时如果它很小并且在你的代码中非关键部分,它也可能不内联一个函数
    记住如果一个函数被标记为noinline,调用函数将很小并且,它本身是编译内联的一个代表。
    我的理解是_AfxInitManaged()中如果调用了其他函数,则它所调用 的函数不能是内联函数,但_AfxInitManaged()本身是一个内联函数,不知道是否正确,期待其他高手的解释。
      

  3.   

    如果它是__declspec(   noinline   )   function(),我明白;__declspec   (inline )function(),我也明白,但是他们放到了一起,就不明白了。这个函数到底是 noinline   还是inline ?