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

Add a helper for creating a CharSpan from a C string. #14277

Merged
merged 1 commit into from
Jan 26, 2022

Conversation

bzbarsky-apple
Copy link
Contributor

Hides the strlen people have to keep doing.

Problem

Lots of CharSpan(foo, strlen(foo)).

Change overview

Add CharSpan::fromCharString.

Testing

No behavior changes, just slightly cleaner code.

Hides the strlen people have to keep doing.
@github-actions
Copy link

github-actions bot commented Jan 26, 2022

PR #14277: Size comparison from 0b5e18a to 37c64e1

Increases (18 builds for cyw30739, k32w, linux, mbed, nrfconnect, qpg)
platform target config section 0b5e18a 37c64e1 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 579854 579886 32 0.0
.app_xip_area 484776 484808 32 0.0
k32w light k32w061+release (read/write) 664580 664628 48 0.0
.text 579316 579364 48 0.0
lock k32w061+release (read/write) 665632 665664 32 0.0
.text 580080 580112 32 0.0
linux chip-tool-ipv6only arm64 (read only) 8724804 8724820 16 0.0
.text 7348612 7348628 16 0.0
thermostat-no-ble arm64 (read only) 2058356 2058372 16 0.0
.text 1711200 1711216 16 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2354720 2354784 64 0.0
.text 1317320 1317384 64 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2340704 2340768 64 0.0
.text 1303304 1303368 64 0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2307456 2307520 64 0.0
.text 1270056 1270120 64 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 948599 948663 64 0.0
text 641312 641376 64 0.0
nrf52840dk_nrf52840+rpc (read/write) 934099 934163 64 0.0
text 636708 636772 64 0.0
nrf52840dongle_nrf52840 (read/write) 999275 999339 64 0.0
text 673512 673576 64 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 858438 858502 64 0.0
text 558228 558292 64 0.0
lock-app nrf52840dk_nrf52840 (read/write) 915767 915831 64 0.0
text 614076 614140 64 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 825790 825854 64 0.0
text 531028 531092 64 0.0
pump-app nrf52840dk_nrf52840 (read/write) 918427 918491 64 0.0
text 616540 616604 64 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 913611 913675 64 0.0
text 612572 612636 64 0.0
qpg lighting-app qpg6105+debug (read only) 571420 571468 48 0.0
.text 566100 566148 48 0.0
lock-app qpg6105+debug (read only) 517660 517708 48 0.0
.text 512340 512388 48 0.0
Decreases (3 builds for esp32, telink)
platform target config section 0b5e18a 37c64e1 change % change
esp32 all-clusters-app c3devkit (read only) 920684 920582 -102 -0.0
.flash.text 920684 920582 -102 -0.0
m5stack (read only) 969667 969655 -12 -0.0
.flash.text 964283 964271 -12 -0.0
telink lighting-app tlsr9518adk80d (read/write) 847646 847630 -16 -0.0
text 592488 592474 -14 -0.0
Full report (33 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 0b5e18a 37c64e1 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 579854 579886 32 0.0
.app_xip_area 484776 484808 32 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 842596 0 0.0
(read/write) 127364 127364 0 0.0
.bss 125464 125464 0 0.0
.data 1900 1900 0 0.0
.text 842588 842588 0 0.0
BRD4161A+rpc (read only) 829952 829952 0 0.0
(read/write) 144024 144024 0 0.0
.bss 142024 142024 0 0.0
.data 2000 2000 0 0.0
.text 829944 829944 0 0.0
window-app BRD4161A (read only) 814924 814924 0 0.0
(read/write) 126020 126020 0 0.0
.bss 124164 124164 0 0.0
.data 1856 1856 0 0.0
.text 814916 814916 0 0.0
esp32 all-clusters-app c3devkit (read only) 920684 920582 -102 -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 920684 920582 -102 -0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 969667 969655 -12 -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 964283 964271 -12 -0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 664580 664628 48 0.0
.bss 77596 77596 0 0.0
.data 1868 1868 0 0.0
.text 579316 579364 48 0.0
lock k32w061+release (read/write) 665632 665664 32 0.0
.bss 77860 77860 0 0.0
.data 1892 1892 0 0.0
.text 580080 580112 32 0.0
linux chip-tool-ipv6only arm64 (read only) 8724804 8724820 16 0.0
(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 7348628 16 0.0
thermostat-no-ble arm64 (read only) 2058356 2058372 16 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 1711200 1711216 16 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2354720 2354784 64 0.0
.bss 189548 189548 0 0.0
.data 5296 5296 0 0.0
.text 1317320 1317384 64 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2340704 2340768 64 0.0
.bss 181072 181072 0 0.0
.data 5576 5576 0 0.0
.text 1303304 1303368 64 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2307456 2307520 64 0.0
.bss 180968 180968 0 0.0
.data 5568 5568 0 0.0
.text 1270056 1270120 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
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 948599 948663 64 0.0
bss 119160 119160 0 0.0
rodata 110540 110540 0 0.0
text 641312 641376 64 0.0
nrf52840dk_nrf52840+rpc (read/write) 934099 934163 64 0.0
bss 116204 116204 0 0.0
rodata 102992 102992 0 0.0
text 636708 636772 64 0.0
nrf52840dongle_nrf52840 (read/write) 999275 999339 64 0.0
bss 122000 122000 0 0.0
rodata 115292 115292 0 0.0
text 673512 673576 64 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 858438 858502 64 0.0
bss 115948 115948 0 0.0
rodata 103712 103712 0 0.0
text 558228 558292 64 0.0
lock-app nrf52840dk_nrf52840 (read/write) 915767 915831 64 0.0
bss 119208 119208 0 0.0
rodata 105076 105076 0 0.0
text 614076 614140 64 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 825790 825854 64 0.0
bss 116024 116024 0 0.0
rodata 98304 98304 0 0.0
text 531028 531092 64 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) 918427 918491 64 0.0
bss 118952 118952 0 0.0
rodata 105464 105464 0 0.0
text 616540 616604 64 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 913611 913675 64 0.0
bss 118980 118980 0 0.0
rodata 104568 104568 0 0.0
text 612572 612636 64 0.0
shell nrf52840dk_nrf52840 (read/write) 798219 798219 0 0.0
bss 109776 109776 0 0.0
rodata 78288 78288 0 0.0
text 533648 533648 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 451324 451324 0 0.0
p6 all-clusters-app default (read/write) 2414672 2414672 0 0.0
.bss 117892 117892 0 0.0
.data 2584 2584 0 0.0
.text 1372936 1372936 0 0.0
light-app default (read/write) 2338168 2338168 0 0.0
.bss 105652 105652 0 0.0
.data 2408 2408 0 0.0
.text 1296432 1296432 0 0.0
lock-app default (read/write) 2303720 2303720 0 0.0
.bss 105396 105396 0 0.0
.data 2360 2360 0 0.0
.text 1261984 1261984 0 0.0
qpg lighting-app qpg6105+debug (read only) 571420 571468 48 0.0
(read/write) 146936 146936 0 0.0
.bss 89808 89808 0 0.0
.data 1060 1060 0 0.0
.text 566100 566148 48 0.0
lock-app qpg6105+debug (read only) 517660 517708 48 0.0
(read/write) 146940 146940 0 0.0
.bss 89280 89280 0 0.0
.data 992 992 0 0.0
.text 512340 512388 48 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) 847646 847630 -16 -0.0
bss 87608 87608 0 0.0
noinit 37160 37160 0 0.0
text 592488 592474 -14 -0.0

@woody-apple
Copy link
Contributor

Fast tracking, given this is a simple swap in, and tests pass.

@woody-apple woody-apple merged commit 818213b into project-chip:master Jan 26, 2022
@bzbarsky-apple bzbarsky-apple deleted the charspan-helper branch January 26, 2022 04:38
selissia pushed a commit to selissia/connectedhomeip that referenced this pull request Jan 28, 2022
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.

2 participants