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

AP_Math: Add missing constexpr #13726

Merged
merged 1 commit into from
Mar 16, 2020
Merged

Conversation

patrickelectric
Copy link
Member

Signed-off-by: Patrick José Pereira patrickelectric@gmail.com

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
@WickedShell
Copy link
Contributor

@patrickelectric do you get any changes in the resulting build from this? I'm guessing not, but it'd be an interesting note here.

@patrickelectric
Copy link
Member Author

The patch only adds constexpr keyword to allow these functions to run at compile and runtime, the results of the functions does not change.

@WickedShell
Copy link
Contributor

I realize that, I was curious if it actually has helped the compiler at all, or if its just a no op change for being more verbose.

@patrickelectric
Copy link
Member Author

patrickelectric commented Mar 6, 2020

@WickedShell I just check the binary and saw that it does not change the size but it changes the binary content.
diff ardusub_with_constexpr_objdumṕ ardusub_without_constexpr_objdumṕ
http://ix.io/2dyh
(objdump output of constexpr is 210 bytes smaller)

This patch also empowers future patchs that want to create functions with constexpr that uses the ones in this patch.

@tridge tridge merged commit 1635054 into ArduPilot:master Mar 16, 2020
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

Successfully merging this pull request may close these issues.

None yet

5 participants