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_Scripting: allow to mark arguments for no range check, optimize for size #18221
Conversation
Interesting to note that the generated bindings are now |
Saves quite abit more flash here than it did localy..... I had it saving 6k, Turns out just to be the new compiler, old compiler |
f9570c7
to
92c48ef
Compare
With this patch scripting on Durandal still costs 135k! The majority of that is the included lua source, roughly 40k is bindings and such on the AP side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we need the initilization as this is compiled with gcc and not g++?
I think this looks good, but I'd like @WickedShell to take a look |
92c48ef
to
acaab73
Compare
rebased |
acaab73
to
bef539c
Compare
rebased to get past semaphore. |
@WickedShell please have a look. If you can't look in the next week I think we should merge |
This saves quite abit of flash. Majority of the saving from
Os
and about 3k from skipping range checks on floats that are currently-FLT_MAX FLT_MAX
. Removing the initialization saves just less than 200bytes. Removing the extraelse
saves nothing.I don't see any other low hanging fruit without getting a bit more into the lua side of things. There are quite a few things that look like they might be a easy saving, but in fact it is so easy that the compiler is already doing it in any case.
We could save lots more if we decided to remove more range checks, in many cases the
c++
function will check for us in any-case, sensor index's for example, but I think more than I have done here really ought to be looked at individually, there could well be some functions where ignoring the range checks would be bad.