magiclantern_simplified icon indicating copy to clipboard operation
magiclantern_simplified copied to clipboard

Test making imath.h macros into functions

Open reticulatedpines opened this issue 9 months ago • 0 comments

Generally, it's a bad idea to have macros that act like functions. Instead, use functions, and let the compiler optimise. You can force inline if you really want.

imath.h does this a lot. We use these frequently, e.g. MIN(), and we generally care more about size than speed. We use -Os, which is in conflict with macros forcing code to be duplicated.

We should test converting all the function-like macros to functions. How much size does it save, and how much, if any, performance does it cost?

reticulatedpines avatar May 06 '24 15:05 reticulatedpines