Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test making imath.h macros into functions #145

Open
reticulatedpines opened this issue May 6, 2024 · 0 comments
Open

Test making imath.h macros into functions #145

reticulatedpines opened this issue May 6, 2024 · 0 comments

Comments

@reticulatedpines
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant