"Dave Korn" <[EMAIL PROTECTED]> writes: > Sorry for butting in, but I just can't follow the reasoning here. Unless a > function is only ever used once and is inlined at the single callsite, or > unless the prolog and epilog are several times the size of the function body, > isn't inlining /always/ (not just "typically", but actually *always*) going to > increase code size? I feel I must be missing something really obvious... is > it just that the other optimisations that become possible on inline code > usually compensate?
It's pretty much always going to be a win to inline int f (int a) { return g (a); } And while that kind of thing looks silly in isolation, it is quite common in class methods in C++. Ian