At least in g++, inlined functions that are inlined can contain function calls. ex:
inline void p(void) {printf("Hi there.\n");}
can be inlined.
But I believe most compilers won''t inline functions that have control structures. i.e. for loops, while loops, etc. Or I could be thinking of something completely different.
inline funcs
I believe your right about the for/while loops as well as switches. About the function calls inside an inline function, wouldn't the function that you call have to be inlined as well? .. oh, maybe not actually. I think I'll have a gander at the docs again.
Compiling in release mode does not give as great a leap in speed as some seem to believe. It will not magicly optimize your code and make it run like professionaly developed games.
It will give you a small speed increase, but mostly because DirectX won't be spitting out all that almost useless debug information.
Edited by - Gromit on 3/1/00 1:37:45 AM
Compiling in release mode does not give as great a leap in speed as some seem to believe. It will not magicly optimize your code and make it run like professionaly developed games.
It will give you a small speed increase, but mostly because DirectX won't be spitting out all that almost useless debug information.
Edited by - Gromit on 3/1/00 1:37:45 AM
Ok, let''s say I have the p() function from my previous post. whenever the compiler sees p() it''ll substitute printf("Hi there.\n"); If you just do a compile to assembly code, it''s pretty easy to see.
Oh some compilers will also not inline function with local variables, especially static local variables.
Oh some compilers will also not inline function with local variables, especially static local variables.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement