Why is inlining considered faster than a function call?

前端 未结 16 1562
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 04:04

Now, I know it\'s because there\'s not the overhead of calling a function, but is the overhead of calling a function really that heavy (and worth the bloat of having it inli

16条回答
  •  甜味超标
    2020-12-13 04:39

    Inlining a function is a suggestion to compiler to replace function call with definition. If its replaced, then there will be no function calling stack operations [push, pop]. But its not guaranteed always. :)

    --Cheers

提交回复
热议问题