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

RFC: Remove the ReadClient* parameter to ReadClient::Callbacks #14013

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

mspang
Copy link
Contributor

@mspang mspang commented Jan 25, 2022

Problem

Currently each ReadClient callback takes as a parameter a pointer to the
ReadClient itself. This is not very useful and introduces undesirable
coupling: It prevents creating another class (say, MockReadClient or
NextGenReadClient) that is compatible with existing callbacks
without the same concrete implementation class.

This is showing up very concretely in tests that are passing "nullptr"
since their test double cannot be passed through the callback.

Change overview

Remove the ReadClient pointer from each callback. There are few
uses of this, and none are crucial, as the creator of the read client
already has as pointer to it.

The only nontrivial use of of this is freeing read clients in OnDone,
which is quite subtle and problematic because shutting down
with pending IM callbacks will leak the client. In any case, we
can preserve the semantics by simply adopting the client
into the callback.

Testing

Unit tests.

@mspang mspang requested a review from mrjerryjohns January 25, 2022 07:47
@github-actions
Copy link

github-actions bot commented Jan 25, 2022

PR #14013: Size comparison from f0f5de0 to a21b332

Decreases (9 builds for cyw30739, k32w, p6, qpg, telink)
platform target config section f0f5de0 a21b332 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 573714 573690 -24 -0.0
.app_xip_area 479016 478992 -24 -0.0
k32w light k32w061+release (read/write) 660864 660848 -16 -0.0
.text 575972 575956 -16 -0.0
lock k32w061+release (read/write) 661796 661780 -16 -0.0
.text 576616 576600 -16 -0.0
p6 all-clusters-app default (read/write) 2407448 2407416 -32 -0.0
.text 1365712 1365680 -32 -0.0
light-app default (read/write) 2330256 2330224 -32 -0.0
.text 1288520 1288488 -32 -0.0
lock-app default (read/write) 2299664 2299648 -16 -0.0
.text 1257928 1257912 -16 -0.0
qpg lighting-app qpg6105+debug (read only) 567092 567068 -24 -0.0
.text 561772 561748 -24 -0.0
lock-app qpg6105+debug (read only) 515752 515720 -32 -0.0
.text 510432 510400 -32 -0.0
telink lighting-app tlsr9518adk80d (read/write) 841062 841046 -16 -0.0
text 588184 588170 -14 -0.0
Full report (10 builds for cyw30739, k32w, p6, qpg, telink)
platform target config section f0f5de0 a21b332 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 573714 573690 -24 -0.0
.app_xip_area 479016 478992 -24 -0.0
.bss 77444 77444 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
k32w light k32w061+release (read/write) 660864 660848 -16 -0.0
.bss 77224 77224 0 0.0
.data 1868 1868 0 0.0
.text 575972 575956 -16 -0.0
lock k32w061+release (read/write) 661796 661780 -16 -0.0
.bss 77488 77488 0 0.0
.data 1892 1892 0 0.0
.text 576616 576600 -16 -0.0
p6 all-clusters-app default (read/write) 2407448 2407416 -32 -0.0
.bss 114428 114428 0 0.0
.data 2584 2584 0 0.0
.text 1365712 1365680 -32 -0.0
light-app default (read/write) 2330256 2330224 -32 -0.0
.bss 105272 105272 0 0.0
.data 2408 2408 0 0.0
.text 1288520 1288488 -32 -0.0
lock-app default (read/write) 2299664 2299648 -16 -0.0
.bss 105024 105024 0 0.0
.data 2360 2360 0 0.0
.text 1257928 1257912 -16 -0.0
qpg lighting-app qpg6105+debug (read only) 567092 567068 -24 -0.0
(read/write) 146936 146936 0 0.0
.bss 89416 89416 0 0.0
.data 1060 1060 0 0.0
.text 561772 561748 -24 -0.0
lock-app qpg6105+debug (read only) 515752 515720 -32 -0.0
(read/write) 146940 146940 0 0.0
.bss 88896 88896 0 0.0
.data 992 992 0 0.0
.text 510432 510400 -32 -0.0
persistent-storage-app qpg6105+debug (read only) 107140 107140 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38504 38504 0 0.0
.data 288 288 0 0.0
.text 101820 101820 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 841062 841046 -16 -0.0
bss 87224 87224 0 0.0
noinit 37160 37160 0 0.0
text 588184 588170 -14 -0.0

@github-actions
Copy link

github-actions bot commented Jan 25, 2022

PR #14013: Size comparison from e169fcf to feb7df8

Decreases (24 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section e169fcf feb7df8 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 573714 573690 -24 -0.0
.app_xip_area 479016 478992 -24 -0.0
efr32 lighting-app BRD4161A (read only) 835484 835452 -32 -0.0
.text 835476 835444 -32 -0.0
BRD4161A+rpc (read only) 822864 822848 -16 -0.0
.text 822856 822840 -16 -0.0
window-app BRD4161A (read only) 806324 806292 -32 -0.0
.text 806316 806284 -32 -0.0
esp32 all-clusters-app c3devkit (read only) 919202 919188 -14 -0.0
.flash.text 919202 919188 -14 -0.0
m5stack (read only) 967535 967515 -20 -0.0
.flash.text 962151 962131 -20 -0.0
k32w light k32w061+release (read/write) 660864 660848 -16 -0.0
.text 575972 575956 -16 -0.0
lock k32w061+release (read/write) 661796 661780 -16 -0.0
.text 576616 576600 -16 -0.0
linux chip-tool-ipv6only arm64 (read only) 8639540 8635108 -4432 -0.1
.text 7267860 7263428 -4432 -0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2348784 2348720 -64 -0.0
.text 1311360 1311296 -64 -0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 942175 942143 -32 -0.0
text 637104 637080 -24 -0.0
nrf52840dk_nrf52840+rpc (read/write) 927675 927659 -16 -0.0
text 632500 632476 -24 -0.0
nrf52840dongle_nrf52840 (read/write) 992855 992823 -32 -0.0
text 669304 669280 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 852034 852002 -32 -0.0
text 554024 554000 -24 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 912683 912651 -32 -0.0
text 612680 612656 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 822702 822686 -16 -0.0
text 529636 529612 -24 -0.0
pump-app nrf52840dk_nrf52840 (read/write) 915339 915323 -16 -0.0
text 615148 615124 -24 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 910523 910491 -32 -0.0
text 611176 611152 -24 -0.0
p6 all-clusters-app default (read/write) 2407448 2407416 -32 -0.0
.text 1365712 1365680 -32 -0.0
light-app default (read/write) 2330256 2330224 -32 -0.0
.text 1288520 1288488 -32 -0.0
lock-app default (read/write) 2299664 2299648 -16 -0.0
.text 1257928 1257912 -16 -0.0
qpg lighting-app qpg6105+debug (read only) 567092 567068 -24 -0.0
.text 561772 561748 -24 -0.0
lock-app qpg6105+debug (read only) 515752 515720 -32 -0.0
.text 510432 510400 -32 -0.0
telink lighting-app tlsr9518adk80d (read/write) 841062 841046 -16 -0.0
text 588184 588170 -14 -0.0
Full report (33 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section e169fcf feb7df8 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 573714 573690 -24 -0.0
.app_xip_area 479016 478992 -24 -0.0
.bss 77444 77444 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
efr32 lighting-app BRD4161A (read only) 835484 835452 -32 -0.0
(read/write) 126980 126980 0 0.0
.bss 125080 125080 0 0.0
.data 1900 1900 0 0.0
.text 835476 835444 -32 -0.0
BRD4161A+rpc (read only) 822864 822848 -16 -0.0
(read/write) 143640 143640 0 0.0
.bss 141640 141640 0 0.0
.data 2000 2000 0 0.0
.text 822856 822840 -16 -0.0
window-app BRD4161A (read only) 806324 806292 -32 -0.0
(read/write) 125624 125624 0 0.0
.bss 123768 123768 0 0.0
.data 1856 1856 0 0.0
.text 806316 806284 -32 -0.0
esp32 all-clusters-app c3devkit (read only) 919202 919188 -14 -0.0
(read/write) 1376810 1376810 0 0.0
.dram0.bss 67376 67376 0 0.0
.dram0.data 14244 14244 0 0.0
.flash.rodata 176064 176064 0 0.0
.flash.text 919202 919188 -14 -0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 967535 967515 -20 -0.0
(read/write) 443240 443240 0 0.0
.dram0.bss 71856 71856 0 0.0
.dram0.data 34032 34032 0 0.0
.flash.rodata 205224 205224 0 0.0
.flash.text 962151 962131 -20 -0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 660864 660848 -16 -0.0
.bss 77224 77224 0 0.0
.data 1868 1868 0 0.0
.text 575972 575956 -16 -0.0
lock k32w061+release (read/write) 661796 661780 -16 -0.0
.bss 77488 77488 0 0.0
.data 1892 1892 0 0.0
.text 576616 576600 -16 -0.0
linux chip-tool-ipv6only arm64 (read only) 8639540 8635108 -4432 -0.1
(read/write) 390961 390961 0 0.0
.bss 56049 56049 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 260976 260976 0 0.0
.dynamic 560 560 0 0.0
.got 69056 69056 0 0.0
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 532716 532716 0 0.0
.text 7267860 7263428 -4432 -0.1
thermostat-no-ble arm64 (read only) 2050428 2050428 0 0.0
(read/write) 145969 145969 0 0.0
.bss 64897 64897 0 0.0
.data 904 904 0 0.0
.data.rel.ro 73160 73160 0 0.0
.dynamic 560 560 0 0.0
.got 4056 4056 0 0.0
.init 24 24 0 0.0
.init_array 320 320 0 0.0
.rodata 129948 129948 0 0.0
.text 1706080 1706080 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2348784 2348720 -64 -0.0
.bss 186084 186084 0 0.0
.data 5296 5296 0 0.0
.text 1311360 1311296 -64 -0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2333984 2333984 0 0.0
.bss 180688 180688 0 0.0
.data 5576 5576 0 0.0
.text 1296584 1296584 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2304568 2304568 0 0.0
.bss 180592 180592 0 0.0
.data 5568 5568 0 0.0
.text 1267168 1267168 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2053896 2053896 0 0.0
.bss 156876 156876 0 0.0
.data 4864 4864 0 0.0
.text 1016496 1016496 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 942175 942143 -32 -0.0
bss 118776 118776 0 0.0
rodata 108708 108708 0 0.0
text 637104 637080 -24 -0.0
nrf52840dk_nrf52840+rpc (read/write) 927675 927659 -16 -0.0
bss 115820 115820 0 0.0
rodata 101160 101160 0 0.0
text 632500 632476 -24 -0.0
nrf52840dongle_nrf52840 (read/write) 992855 992823 -32 -0.0
bss 121616 121616 0 0.0
rodata 113464 113464 0 0.0
text 669304 669280 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 852034 852002 -32 -0.0
bss 115564 115564 0 0.0
rodata 101884 101884 0 0.0
text 554024 554000 -24 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 912683 912651 -32 -0.0
bss 118828 118828 0 0.0
rodata 103768 103768 0 0.0
text 612680 612656 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 822702 822686 -16 -0.0
bss 115648 115648 0 0.0
rodata 96992 96992 0 0.0
text 529636 529612 -24 -0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 541835 541835 0 0.0
bss 52588 52588 0 0.0
rodata 50104 50104 0 0.0
text 376940 376940 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 915339 915323 -16 -0.0
bss 118576 118576 0 0.0
rodata 104152 104152 0 0.0
text 615148 615124 -24 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 910523 910491 -32 -0.0
bss 118600 118600 0 0.0
rodata 103256 103256 0 0.0
text 611176 611152 -24 -0.0
shell nrf52840dk_nrf52840 (read/write) 798203 798203 0 0.0
bss 109776 109776 0 0.0
rodata 78288 78288 0 0.0
text 533644 533644 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 711022 711022 0 0.0
bss 107664 107664 0 0.0
rodata 72592 72592 0 0.0
text 451320 451320 0 0.0
p6 all-clusters-app default (read/write) 2407448 2407416 -32 -0.0
.bss 114428 114428 0 0.0
.data 2584 2584 0 0.0
.text 1365712 1365680 -32 -0.0
light-app default (read/write) 2330256 2330224 -32 -0.0
.bss 105272 105272 0 0.0
.data 2408 2408 0 0.0
.text 1288520 1288488 -32 -0.0
lock-app default (read/write) 2299664 2299648 -16 -0.0
.bss 105024 105024 0 0.0
.data 2360 2360 0 0.0
.text 1257928 1257912 -16 -0.0
qpg lighting-app qpg6105+debug (read only) 567092 567068 -24 -0.0
(read/write) 146936 146936 0 0.0
.bss 89416 89416 0 0.0
.data 1060 1060 0 0.0
.text 561772 561748 -24 -0.0
lock-app qpg6105+debug (read only) 515752 515720 -32 -0.0
(read/write) 146940 146940 0 0.0
.bss 88896 88896 0 0.0
.data 992 992 0 0.0
.text 510432 510400 -32 -0.0
persistent-storage-app qpg6105+debug (read only) 107140 107140 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38504 38504 0 0.0
.data 288 288 0 0.0
.text 101820 101820 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 841062 841046 -16 -0.0
bss 87224 87224 0 0.0
noinit 37160 37160 0 0.0
text 588184 588170 -14 -0.0

@github-actions
Copy link

github-actions bot commented Jan 25, 2022

PR #14013: Size comparison from 0902641 to 72c9d7e

Decreases (23 builds for cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 0902641 72c9d7e change % change
cyw30739 light cyw930739m2evb_01 (read/write) 572258 572234 -24 -0.0
.app_xip_area 477320 477296 -24 -0.0
efr32 lighting-app BRD4161A (read only) 832688 832656 -32 -0.0
.text 832680 832648 -32 -0.0
BRD4161A+rpc (read only) 820068 820052 -16 -0.0
.text 820060 820044 -16 -0.0
window-app BRD4161A (read only) 808864 808848 -16 -0.0
.text 808856 808840 -16 -0.0
k32w light k32w061+release (read/write) 660496 660464 -32 -0.0
.text 575372 575340 -32 -0.0
lock k32w061+release (read/write) 661392 661360 -32 -0.0
.text 575980 575948 -32 -0.0
linux chip-tool-ipv6only arm64 (read only) 8697804 8692860 -4944 -0.1
.text 7326532 7321588 -4944 -0.1
mbed lighting-app CY8CPROTO_062_4343W+release (read/write) 2332232 2332168 -64 -0.0
.text 1294832 1294768 -64 -0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2302816 2302752 -64 -0.0
.text 1265416 1265352 -64 -0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 941035 941019 -16 -0.0
text 635356 635332 -24 -0.0
nrf52840dk_nrf52840+rpc (read/write) 926519 926487 -32 -0.0
text 630748 630724 -24 -0.0
nrf52840dongle_nrf52840 (read/write) 991679 991663 -16 -0.0
text 667552 667528 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 850862 850846 -16 -0.0
text 552276 552252 -24 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 911507 911491 -16 -0.0
text 610932 610908 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 821578 821562 -16 -0.0
text 527888 527864 -24 -0.0
pump-app nrf52840dk_nrf52840 (read/write) 914183 914151 -32 -0.0
text 613396 613372 -24 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 909351 909335 -16 -0.0
text 609428 609404 -24 -0.0
p6 all-clusters-app default (read/write) 2408048 2408016 -32 -0.0
.text 1366312 1366280 -32 -0.0
light-app default (read/write) 2327768 2327752 -16 -0.0
.text 1286032 1286016 -16 -0.0
lock-app default (read/write) 2297208 2297192 -16 -0.0
.text 1255472 1255456 -16 -0.0
qpg lighting-app qpg6105+debug (read only) 565568 565544 -24 -0.0
.text 560248 560224 -24 -0.0
lock-app qpg6105+debug (read only) 514324 514292 -32 -0.0
.text 509004 508972 -32 -0.0
telink lighting-app tlsr9518adk80d (read/write) 839534 839518 -16 -0.0
text 586050 586036 -14 -0.0
Full report (31 builds for cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 0902641 72c9d7e change % change
cyw30739 light cyw930739m2evb_01 (read/write) 572258 572234 -24 -0.0
.app_xip_area 477320 477296 -24 -0.0
.bss 77684 77684 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
efr32 lighting-app BRD4161A (read only) 832688 832656 -32 -0.0
(read/write) 127216 127216 0 0.0
.bss 125312 125312 0 0.0
.data 1900 1900 0 0.0
.text 832680 832648 -32 -0.0
BRD4161A+rpc (read only) 820068 820052 -16 -0.0
(read/write) 143872 143872 0 0.0
.bss 141872 141872 0 0.0
.data 2000 2000 0 0.0
.text 820060 820044 -16 -0.0
window-app BRD4161A (read only) 808864 808848 -16 -0.0
(read/write) 125872 125872 0 0.0
.bss 124016 124016 0 0.0
.data 1856 1856 0 0.0
.text 808856 808840 -16 -0.0
k32w light k32w061+release (read/write) 660496 660464 -32 -0.0
.bss 77456 77456 0 0.0
.data 1868 1868 0 0.0
.text 575372 575340 -32 -0.0
lock k32w061+release (read/write) 661392 661360 -32 -0.0
.bss 77720 77720 0 0.0
.data 1892 1892 0 0.0
.text 575980 575948 -32 -0.0
linux chip-tool-ipv6only arm64 (read only) 8697804 8692860 -4944 -0.1
(read/write) 390817 390817 0 0.0
.bss 56017 56017 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 260888 260888 0 0.0
.dynamic 560 560 0 0.0
.got 69040 69040 0 0.0
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 532532 532532 0 0.0
.text 7326532 7321588 -4944 -0.1
thermostat-no-ble arm64 (read only) 2043436 2043436 0 0.0
(read/write) 146625 146625 0 0.0
.bss 65649 65649 0 0.0
.data 904 904 0 0.0
.data.rel.ro 73072 73072 0 0.0
.dynamic 560 560 0 0.0
.got 4048 4048 0 0.0
.init 24 24 0 0.0
.init_array 320 320 0 0.0
.rodata 130620 130620 0 0.0
.text 1698512 1698512 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2349912 2349912 0 0.0
.bss 189404 189404 0 0.0
.data 5296 5296 0 0.0
.text 1312512 1312512 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2332232 2332168 -64 -0.0
.bss 180920 180920 0 0.0
.data 5576 5576 0 0.0
.text 1294832 1294768 -64 -0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2302816 2302752 -64 -0.0
.bss 180824 180824 0 0.0
.data 5568 5568 0 0.0
.text 1265416 1265352 -64 -0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2053896 2053896 0 0.0
.bss 156876 156876 0 0.0
.data 4864 4864 0 0.0
.text 1016496 1016496 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 941035 941019 -16 -0.0
bss 119012 119012 0 0.0
rodata 109072 109072 0 0.0
text 635356 635332 -24 -0.0
nrf52840dk_nrf52840+rpc (read/write) 926519 926487 -32 -0.0
bss 116056 116056 0 0.0
rodata 101524 101524 0 0.0
text 630748 630724 -24 -0.0
nrf52840dongle_nrf52840 (read/write) 991679 991663 -16 -0.0
bss 121852 121852 0 0.0
rodata 113824 113824 0 0.0
text 667552 667528 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 850862 850846 -16 -0.0
bss 115796 115796 0 0.0
rodata 102248 102248 0 0.0
text 552276 552252 -24 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 911507 911491 -16 -0.0
bss 119064 119064 0 0.0
rodata 104128 104128 0 0.0
text 610932 610908 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 821578 821562 -16 -0.0
bss 115880 115880 0 0.0
rodata 97356 97356 0 0.0
text 527888 527864 -24 -0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 541835 541835 0 0.0
bss 52588 52588 0 0.0
rodata 50104 50104 0 0.0
text 376940 376940 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 914183 914151 -32 -0.0
bss 118808 118808 0 0.0
rodata 104516 104516 0 0.0
text 613396 613372 -24 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 909351 909335 -16 -0.0
bss 118836 118836 0 0.0
rodata 103620 103620 0 0.0
text 609428 609404 -24 -0.0
shell nrf52840dk_nrf52840 (read/write) 798203 798203 0 0.0
bss 109776 109776 0 0.0
rodata 78288 78288 0 0.0
text 533640 533640 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 711022 711022 0 0.0
bss 107664 107664 0 0.0
rodata 72592 72592 0 0.0
text 451316 451316 0 0.0
p6 all-clusters-app default (read/write) 2408048 2408016 -32 -0.0
.bss 117748 117748 0 0.0
.data 2584 2584 0 0.0
.text 1366312 1366280 -32 -0.0
light-app default (read/write) 2327768 2327752 -16 -0.0
.bss 105512 105512 0 0.0
.data 2408 2408 0 0.0
.text 1286032 1286016 -16 -0.0
lock-app default (read/write) 2297208 2297192 -16 -0.0
.bss 105256 105256 0 0.0
.data 2360 2360 0 0.0
.text 1255472 1255456 -16 -0.0
qpg lighting-app qpg6105+debug (read only) 565568 565544 -24 -0.0
(read/write) 146936 146936 0 0.0
.bss 89656 89656 0 0.0
.data 1060 1060 0 0.0
.text 560248 560224 -24 -0.0
lock-app qpg6105+debug (read only) 514324 514292 -32 -0.0
(read/write) 146940 146940 0 0.0
.bss 89128 89128 0 0.0
.data 992 992 0 0.0
.text 509004 508972 -32 -0.0
persistent-storage-app qpg6105+debug (read only) 107140 107140 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38504 38504 0 0.0
.data 288 288 0 0.0
.text 101820 101820 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 839534 839518 -16 -0.0
bss 87460 87460 0 0.0
noinit 37160 37160 0 0.0
text 586050 586036 -14 -0.0

@mspang mspang force-pushed the for-chip/readclient-arg branch from 72c9d7e to 4af2028 Compare January 26, 2022 01:03
@github-actions
Copy link

github-actions bot commented Jan 26, 2022

PR #14013: Size comparison from 2e0f64d to 4af2028

Decreases (18 builds for cyw30739, efr32, esp32, k32w, linux, mbed, p6, qpg, telink)
platform target config section 2e0f64d 4af2028 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 579878 579854 -24 -0.0
.app_xip_area 484800 484776 -24 -0.0
efr32 lighting-app BRD4161A (read only) 842596 842564 -32 -0.0
.text 842588 842556 -32 -0.0
BRD4161A+rpc (read only) 829952 829936 -16 -0.0
.text 829944 829928 -16 -0.0
window-app BRD4161A (read only) 814940 814908 -32 -0.0
.text 814932 814900 -32 -0.0
esp32 all-clusters-app c3devkit (read only) 920764 920750 -14 -0.0
.flash.text 920764 920750 -14 -0.0
m5stack (read only) 969699 969679 -20 -0.0
.flash.text 964315 964295 -20 -0.0
k32w light k32w061+release (read/write) 664612 664580 -32 -0.0
.text 579348 579316 -32 -0.0
lock k32w061+release (read/write) 665648 665632 -16 -0.0
.text 580096 580080 -16 -0.0
linux chip-tool-ipv6only arm64 (read only) 8724804 8719860 -4944 -0.1
.text 7348612 7343668 -4944 -0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2354784 2354720 -64 -0.0
.text 1317384 1317320 -64 -0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2340768 2340704 -64 -0.0
.text 1303368 1303304 -64 -0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2307520 2307456 -64 -0.0
.text 1270120 1270056 -64 -0.0
p6 all-clusters-app default (read/write) 2414688 2414656 -32 -0.0
.text 1372952 1372920 -32 -0.0
light-app default (read/write) 2338168 2338152 -16 -0.0
.text 1296432 1296416 -16 -0.0
lock-app default (read/write) 2303720 2303688 -32 -0.0
.text 1261984 1261952 -32 -0.0
qpg lighting-app qpg6105+debug (read only) 571436 571404 -32 -0.0
.text 566116 566084 -32 -0.0
lock-app qpg6105+debug (read only) 517676 517652 -24 -0.0
.text 512356 512332 -24 -0.0
telink lighting-app tlsr9518adk80d (read/write) 847734 847718 -16 -0.0
text 592574 592560 -14 -0.0
Full report (22 builds for cyw30739, efr32, esp32, k32w, linux, mbed, p6, qpg, telink)
platform target config section 2e0f64d 4af2028 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 579878 579854 -24 -0.0
.app_xip_area 484800 484776 -24 -0.0
.bss 77824 77824 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
efr32 lighting-app BRD4161A (read only) 842596 842564 -32 -0.0
(read/write) 127364 127364 0 0.0
.bss 125464 125464 0 0.0
.data 1900 1900 0 0.0
.text 842588 842556 -32 -0.0
BRD4161A+rpc (read only) 829952 829936 -16 -0.0
(read/write) 144024 144024 0 0.0
.bss 142024 142024 0 0.0
.data 2000 2000 0 0.0
.text 829944 829928 -16 -0.0
window-app BRD4161A (read only) 814940 814908 -32 -0.0
(read/write) 126020 126020 0 0.0
.bss 124164 124164 0 0.0
.data 1856 1856 0 0.0
.text 814932 814900 -32 -0.0
esp32 all-clusters-app c3devkit (read only) 920764 920750 -14 -0.0
(read/write) 1384618 1384618 0 0.0
.dram0.bss 70840 70840 0 0.0
.dram0.data 14244 14244 0 0.0
.flash.rodata 180600 180600 0 0.0
.flash.text 920764 920750 -14 -0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 969699 969679 -20 -0.0
(read/write) 451640 451640 0 0.0
.dram0.bss 75584 75584 0 0.0
.dram0.data 34032 34032 0 0.0
.flash.rodata 209896 209896 0 0.0
.flash.text 964315 964295 -20 -0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 664612 664580 -32 -0.0
.bss 77596 77596 0 0.0
.data 1868 1868 0 0.0
.text 579348 579316 -32 -0.0
lock k32w061+release (read/write) 665648 665632 -16 -0.0
.bss 77860 77860 0 0.0
.data 1892 1892 0 0.0
.text 580096 580080 -16 -0.0
linux chip-tool-ipv6only arm64 (read only) 8724804 8719860 -4944 -0.1
(read/write) 392273 392273 0 0.0
.bss 56241 56241 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 261872 261872 0 0.0
.dynamic 560 560 0 0.0
.got 69280 69280 0 0.0
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 534444 534444 0 0.0
.text 7348612 7343668 -4944 -0.1
thermostat-no-ble arm64 (read only) 2058372 2058372 0 0.0
(read/write) 147457 147457 0 0.0
.bss 65857 65857 0 0.0
.data 904 904 0 0.0
.data.rel.ro 73624 73624 0 0.0
.dynamic 560 560 0 0.0
.got 4112 4112 0 0.0
.init 24 24 0 0.0
.init_array 320 320 0 0.0
.rodata 131396 131396 0 0.0
.text 1711216 1711216 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2354784 2354720 -64 -0.0
.bss 189548 189548 0 0.0
.data 5296 5296 0 0.0
.text 1317384 1317320 -64 -0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2340768 2340704 -64 -0.0
.bss 181072 181072 0 0.0
.data 5576 5576 0 0.0
.text 1303368 1303304 -64 -0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2307520 2307456 -64 -0.0
.bss 180968 180968 0 0.0
.data 5568 5568 0 0.0
.text 1270120 1270056 -64 -0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2053960 2053960 0 0.0
.bss 156876 156876 0 0.0
.data 4864 4864 0 0.0
.text 1016560 1016560 0 0.0
p6 all-clusters-app default (read/write) 2414688 2414656 -32 -0.0
.bss 117892 117892 0 0.0
.data 2584 2584 0 0.0
.text 1372952 1372920 -32 -0.0
light-app default (read/write) 2338168 2338152 -16 -0.0
.bss 105652 105652 0 0.0
.data 2408 2408 0 0.0
.text 1296432 1296416 -16 -0.0
lock-app default (read/write) 2303720 2303688 -32 -0.0
.bss 105396 105396 0 0.0
.data 2360 2360 0 0.0
.text 1261984 1261952 -32 -0.0
qpg lighting-app qpg6105+debug (read only) 571436 571404 -32 -0.0
(read/write) 146936 146936 0 0.0
.bss 89808 89808 0 0.0
.data 1060 1060 0 0.0
.text 566116 566084 -32 -0.0
lock-app qpg6105+debug (read only) 517676 517652 -24 -0.0
(read/write) 146940 146940 0 0.0
.bss 89280 89280 0 0.0
.data 992 992 0 0.0
.text 512356 512332 -24 -0.0
persistent-storage-app qpg6105+debug (read only) 107140 107140 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38504 38504 0 0.0
.data 288 288 0 0.0
.text 101820 101820 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 847734 847718 -16 -0.0
bss 87608 87608 0 0.0
noinit 37160 37160 0 0.0
text 592574 592560 -14 -0.0

src/app/ReadClient.h Show resolved Hide resolved
src/app/ReadClient.h Show resolved Hide resolved
src/app/ReadClient.h Outdated Show resolved Hide resolved
src/app/ReadClient.h Outdated Show resolved Hide resolved
src/app/ReadClient.h Outdated Show resolved Hide resolved
src/controller/python/chip/clusters/attribute.cpp Outdated Show resolved Hide resolved
@andy31415
Copy link
Contributor

fast track: generally a refector except the deletion bits which was approved by a domain owner. PR has been up sufficient time for cross timezone review.

@mspang mspang force-pushed the for-chip/readclient-arg branch 2 times, most recently from c4ecfb6 to ee34073 Compare January 26, 2022 21:40
Currently each ReadClient callback takes as a parameter a pointer to the
ReadClient itself. This is not very useful and introduces undesirable
coupling: It prevents creating another class (say, MockReadClient or
NextGenReadClient) that is compatible with existing callbacks
without the same concrete implementation class.

This is showing up very concretely in tests that are passing "nullptr"
since their test double cannot be passed through the callback.
@mspang mspang force-pushed the for-chip/readclient-arg branch from ee34073 to c7aa9a1 Compare January 26, 2022 21:59
@github-actions
Copy link

github-actions bot commented Jan 26, 2022

PR #14013: Size comparison from 5429dca to c7aa9a1

Decreases (15 builds for cyw30739, efr32, esp32, k32w, linux, p6, qpg, telink)
platform target config section 5429dca c7aa9a1 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 580330 580306 -24 -0.0
.app_xip_area 485224 485200 -24 -0.0
efr32 lighting-app BRD4161A (read only) 843316 843284 -32 -0.0
.text 843308 843276 -32 -0.0
BRD4161A+rpc (read only) 830672 830656 -16 -0.0
.text 830664 830648 -16 -0.0
window-app BRD4161A (read only) 815948 815932 -16 -0.0
.text 815940 815924 -16 -0.0
esp32 all-clusters-app c3devkit (read only) 921116 921102 -14 -0.0
.flash.text 921116 921102 -14 -0.0
m5stack (read only) 970111 970091 -20 -0.0
.flash.text 964727 964707 -20 -0.0
k32w light k32w061+release (read/write) 665192 665176 -16 -0.0
.text 579896 579880 -16 -0.0
lock k32w061+release (read/write) 666080 666064 -16 -0.0
.text 580496 580480 -16 -0.0
linux chip-tool-ipv6only arm64 (read only) 8904716 8899788 -4928 -0.1
.text 7514868 7509940 -4928 -0.1
p6 all-clusters-app default (read/write) 2415424 2415408 -16 -0.0
.text 1373688 1373672 -16 -0.0
light-app default (read/write) 2338904 2338888 -16 -0.0
.text 1297168 1297152 -16 -0.0
lock-app default (read/write) 2304440 2304424 -16 -0.0
.text 1262704 1262688 -16 -0.0
qpg lighting-app qpg6105+debug (read only) 571964 571932 -32 -0.0
.text 566644 566612 -32 -0.0
lock-app qpg6105+debug (read only) 518060 518028 -32 -0.0
.text 512740 512708 -32 -0.0
telink lighting-app tlsr9518adk80d (read/write) 848046 848030 -16 -0.0
text 592818 592804 -14 -0.0
Full report (17 builds for cyw30739, efr32, esp32, k32w, linux, p6, qpg, telink)
platform target config section 5429dca c7aa9a1 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 580330 580306 -24 -0.0
.app_xip_area 485224 485200 -24 -0.0
.bss 77852 77852 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
efr32 lighting-app BRD4161A (read only) 843316 843284 -32 -0.0
(read/write) 127396 127396 0 0.0
.bss 125496 125496 0 0.0
.data 1900 1900 0 0.0
.text 843308 843276 -32 -0.0
BRD4161A+rpc (read only) 830672 830656 -16 -0.0
(read/write) 144056 144056 0 0.0
.bss 142056 142056 0 0.0
.data 2000 2000 0 0.0
.text 830664 830648 -16 -0.0
window-app BRD4161A (read only) 815948 815932 -16 -0.0
(read/write) 126052 126052 0 0.0
.bss 124196 124196 0 0.0
.data 1856 1856 0 0.0
.text 815940 815924 -16 -0.0
esp32 all-clusters-app c3devkit (read only) 921116 921102 -14 -0.0
(read/write) 1384722 1384722 0 0.0
.dram0.bss 70872 70872 0 0.0
.dram0.data 14244 14244 0 0.0
.flash.rodata 180672 180672 0 0.0
.flash.text 921116 921102 -14 -0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 970111 970091 -20 -0.0
(read/write) 451744 451744 0 0.0
.dram0.bss 75616 75616 0 0.0
.dram0.data 34032 34032 0 0.0
.flash.rodata 209968 209968 0 0.0
.flash.text 964727 964707 -20 -0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 665192 665176 -16 -0.0
.bss 77628 77628 0 0.0
.data 1868 1868 0 0.0
.text 579896 579880 -16 -0.0
lock k32w061+release (read/write) 666080 666064 -16 -0.0
.bss 77892 77892 0 0.0
.data 1892 1892 0 0.0
.text 580496 580480 -16 -0.0
linux chip-tool-ipv6only arm64 (read only) 8904716 8899788 -4928 -0.1
(read/write) 393649 393649 0 0.0
.bss 55377 55377 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 263656 263656 0 0.0
.dynamic 560 560 0 0.0
.got 69728 69728 0 0.0
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 542916 542916 0 0.0
.text 7514868 7509940 -4928 -0.1
thermostat-no-ble arm64 (read only) 2061828 2061828 0 0.0
(read/write) 148113 148113 0 0.0
.bss 66417 66417 0 0.0
.data 904 904 0 0.0
.data.rel.ro 73712 73712 0 0.0
.dynamic 560 560 0 0.0
.got 4128 4128 0 0.0
.init 24 24 0 0.0
.init_array 320 320 0 0.0
.rodata 131428 131428 0 0.0
.text 1714416 1714416 0 0.0
p6 all-clusters-app default (read/write) 2415424 2415408 -16 -0.0
.bss 117924 117924 0 0.0
.data 2584 2584 0 0.0
.text 1373688 1373672 -16 -0.0
light-app default (read/write) 2338904 2338888 -16 -0.0
.bss 105684 105684 0 0.0
.data 2408 2408 0 0.0
.text 1297168 1297152 -16 -0.0
lock-app default (read/write) 2304440 2304424 -16 -0.0
.bss 105428 105428 0 0.0
.data 2360 2360 0 0.0
.text 1262704 1262688 -16 -0.0
qpg lighting-app qpg6105+debug (read only) 571964 571932 -32 -0.0
(read/write) 146936 146936 0 0.0
.bss 89840 89840 0 0.0
.data 1060 1060 0 0.0
.text 566644 566612 -32 -0.0
lock-app qpg6105+debug (read only) 518060 518028 -32 -0.0
(read/write) 146940 146940 0 0.0
.bss 89312 89312 0 0.0
.data 992 992 0 0.0
.text 512740 512708 -32 -0.0
persistent-storage-app qpg6105+debug (read only) 107140 107140 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38504 38504 0 0.0
.data 288 288 0 0.0
.text 101820 101820 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 848046 848030 -16 -0.0
bss 87640 87640 0 0.0
noinit 37160 37160 0 0.0
text 592818 592804 -14 -0.0

@mspang mspang merged commit a2f1743 into project-chip:master Jan 27, 2022
@mspang mspang deleted the for-chip/readclient-arg branch January 27, 2022 01:52
@ATmobica
Copy link
Contributor

@mspang Why did you revert the mbed-os-posix-socket version here?

selissia pushed a commit to selissia/connectedhomeip that referenced this pull request Jan 28, 2022
…ct-chip#14013)

Currently each ReadClient callback takes as a parameter a pointer to the
ReadClient itself. This is not very useful and introduces undesirable
coupling: It prevents creating another class (say, MockReadClient or
NextGenReadClient) that is compatible with existing callbacks
without the same concrete implementation class.

This is showing up very concretely in tests that are passing "nullptr"
since their test double cannot be passed through the callback.
@bzbarsky-apple
Copy link
Contributor

@mspang Why did you revert the mbed-os-posix-socket version here?

I would guess accidental due to bad merge....

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this pull request Feb 1, 2022
The changes in
project-chip#14013 probably
did not mean to roll back the submodule update from
project-chip#12616.
@bzbarsky-apple
Copy link
Contributor

I created #14613 to fix that.

andy31415 pushed a commit that referenced this pull request Feb 1, 2022
The changes in
#14013 probably
did not mean to roll back the submodule update from
#12616.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants