-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Actions: Add generic implementation for the actions cluster. #35568
base: master
Are you sure you want to change the base?
Conversation
PR #35568: Size comparison from 6e8676b to 2612675 Increases above 0.2%:
Full report (42 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, nrfconnect, psoc6, qpg, stm32, telink)
|
2612675
to
bef53be
Compare
PR #35568: Size comparison from 6e8676b to bef53be Increases above 0.2%:
Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink)
|
…ong with name buffer and added events
…of MatterActionsPluginServerInitCallback in example
4cf19e5
to
e0f8801
Compare
PR #35568: Size comparison from dd0ce89 to 0a99a10 Increases above 0.2%:
Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Delegate * gDelegateTable[kActionsDelegateTableSize] = { nullptr }; | ||
|
||
Delegate * GetDelegate(EndpointId aEndpoint) | ||
{ | ||
return (aEndpoint >= kActionsDelegateTableSize ? nullptr : gDelegateTable[aEndpoint]); | ||
} |
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 a bad pattern to continue. We need to have a better state keeping pattern than constantly using global static arrays.
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.
@andy31415 ^^^
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.
The right solutions in general seem to be:
- One cluster instance per endpoint as opposed to having a singleton that handles all endpoint, or
- Some way that the cluster instance maps endpoints to delegates that can be configured sanely at compile time if we want to support size caps on it, or that just does dynamic memory (e.g. std::map) if that's OK for the cluster in question.
I suspect in most cases item 1 is a better idea....
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.
Even with item 1, we would need to map endpoints with the delegates in the server implementations?
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.
With item 1 each cluster instance is a separate object which just has a pointer to its delegate; there is nothing to "map".
PR #35568: Size comparison from dd0ce89 to 717440f Increases above 0.2%:
Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Problem:
Changes:
Testing: