-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fixes for an ideal change #38485
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
base: master
Are you sure you want to change the base?
Fixes for an ideal change #38485
Conversation
e07e7f1
to
fb65598
Compare
dc8316a
to
7432672
Compare
7432672
to
aeed6df
Compare
PR #38485: Size comparison from d1b46b0 to aeed6df Full report (9 builds for telink)
|
a9a8454
to
32f6703
Compare
PR #38485: Size comparison from 7f94ac6 to 32f6703 Full report (14 builds for esp32, nrfconnect, telink)
|
public: | ||
using CommandHandlerInterface::CommandHandlerInterface; | ||
typedef Loop (*CommandIdCallback)(CommandId id, void * context); | ||
typedef Loop (*CommandEntryCallback)(DataModel::AcceptedCommandEntry id, void * context); |
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.
This is not what the old interface is though: old interface only returned an id
and this is the error we are trying to fix.
If we provide a compatibility shim, we have to provide one that converts the id to an entry ... and that is the hard/awkard part.
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.
yes, this change focuses on minimizing code size, but the user will have to change from ::Id to ::Metadata, a very simple task however needs a programmer to do
This is one of 3 proposals I'm drafting for #37139
This is the "Ideal change", Ideal as the user only includes what it needs, and no extra generation will be needed
Advantages
Disadvantages
Mitigation
Not introducing the SHIM but keeping the callback based interface might keep it simple by one line, not sure worth the cost, this change reduces the binary size on most cases
Testing
all UT's still pass