On Friday, February 14, 2014 04:59:26 PM atarob wrote:
Looking through the codebase, I see a lot of very short helper like
functions that are defined in .c files with prototypes in .h files.
means that the compiler cannot inline them outside of that .c file.
wrong? How is that not a performance hit?
I suppose they will be inlined at -O2 level:
Think about it. -O2 is a compiler flag. Optimization happens at compile
time. NOT at link time. If the function is defined in another .c file,
can the compiler, which compiles on .c file at a time, possibly have
to the definition, let alone inline it. That’s why we put inline
that are supposed to be called by other .c files in a .h file. Am I
Posted at Nginx Forum: