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

Make PacketBufferHandle::Get private again. #17567

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

bzbarsky-apple
Copy link
Contributor

People who need a raw buffer that they own should be calling
UnsafeRelease. Get() should not have been made public.

Problem

The API that was made public in #17512 is too easy to misuse.

Change overview

Make it private again.

Testing

No behavior changes.

@github-actions
Copy link

github-actions bot commented Apr 20, 2022

PR #17567: Size comparison from 57471cb to c5b16db

Increases (3 builds for efr32)
platform target config section 57471cb c5b16db change % change
efr32 lighting-app BRD4161A (read only) 905944 905960 16 0.0
.text 905936 905952 16 0.0
BRD4161A+rpc (read only) 940344 940360 16 0.0
.text 940336 940352 16 0.0
window-app BRD4161A (read only) 843432 843448 16 0.0
.text 843424 843440 16 0.0
Full report (32 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 57471cb c5b16db change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 691027 691027 0 0.0
(read/write) 161900 161900 0 0.0
.bss 75912 75912 0 0.0
.data 3396 3396 0 0.0
.rodata 106043 106043 0 0.0
.text 584504 584504 0 0.0
lock-ftd LP_CC2652R7 (read only) 677383 677383 0 0.0
(read/write) 166512 166512 0 0.0
.bss 73936 73936 0 0.0
.data 3220 3220 0 0.0
.rodata 98807 98807 0 0.0
.text 578092 578092 0 0.0
lock-mtd LP_CC2652R7 (read only) 626127 626127 0 0.0
(read/write) 146732 146732 0 0.0
.bss 69656 69656 0 0.0
.data 3220 3220 0 0.0
.rodata 98687 98687 0 0.0
.text 526948 526948 0 0.0
pump-app LP_CC2652R7 (read only) 649187 649187 0 0.0
(read/write) 152500 152500 0 0.0
.bss 74368 74368 0 0.0
.data 3252 3252 0 0.0
.rodata 75379 75379 0 0.0
.text 573320 573320 0 0.0
pump-controller-app LP_CC2652R7 (read only) 642191 642191 0 0.0
(read/write) 151912 151912 0 0.0
.bss 74072 74072 0 0.0
.data 3216 3216 0 0.0
.rodata 78511 78511 0 0.0
.text 563192 563192 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 618170 618170 0 0.0
.app_xip_area 525176 525176 0 0.0
.bss 75652 75652 0 0.0
.data 692 692 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 613118 613118 0 0.0
.app_xip_area 521604 521604 0 0.0
.bss 74204 74204 0 0.0
.data 656 656 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 565746 565746 0 0.0
.app_xip_area 464644 464644 0 0.0
.bss 83496 83496 0 0.0
.data 568 568 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 905944 905960 16 0.0
(read/write) 129384 129384 0 0.0
.bss 127336 127336 0 0.0
.data 2044 2044 0 0.0
.text 905936 905952 16 0.0
BRD4161A+rpc (read only) 940344 940360 16 0.0
(read/write) 146064 146064 0 0.0
.bss 143816 143816 0 0.0
.data 2248 2248 0 0.0
.text 940336 940352 16 0.0
window-app BRD4161A (read only) 843432 843448 16 0.0
(read/write) 127472 127472 0 0.0
.bss 125512 125512 0 0.0
.data 1956 1956 0 0.0
.text 843424 843440 16 0.0
esp32 all-clusters-app c3devkit (read only) 985210 985210 0 0.0
(read/write) 1465954 1465954 0 0.0
.dram0.bss 62376 62376 0 0.0
.dram0.data 14428 14428 0 0.0
.flash.rodata 204696 204696 0 0.0
.flash.text 985210 985210 0 0.0
.iram0.text 62020 62020 0 0.0
m5stack (read only) 1040491 1040491 0 0.0
(read/write) 468112 468112 0 0.0
.dram0.bss 67896 67896 0 0.0
.dram0.data 34168 34168 0 0.0
.flash.rodata 234212 234212 0 0.0
.flash.text 1035107 1035107 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 684172 684172 0 0.0
.bss 77656 77656 0 0.0
.data 2000 2000 0 0.0
.text 598716 598716 0 0.0
lock k32w061+release (read/write) 725256 725256 0 0.0
.bss 78288 78288 0 0.0
.data 1960 1960 0 0.0
.text 639208 639208 0 0.0
linux all-clusters-app debug (read only) 2728761 2728761 0 0.0
(read/write) 149664 149664 0 0.0
.bss 59936 59936 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 81672 81672 0 0.0
.dynamic 608 608 0 0.0
.got 4448 4448 0 0.0
.init 27 27 0 0.0
.init_array 984 984 0 0.0
.rodata 233221 233221 0 0.0
.text 2320674 2320674 0 0.0
bridge-app debug+rpc (read only) 1842637 1842637 0 0.0
(read/write) 92016 92016 0 0.0
.bss 44136 44136 0 0.0
.data 3072 3072 0 0.0
.data.rel.ro 39744 39744 0 0.0
.dynamic 592 592 0 0.0
.got 3920 3920 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 148961 148961 0 0.0
.text 1574533 1574533 0 0.0
chip-tool debug (read only) 10916189 10916189 0 0.0
(read/write) 375120 375120 0 0.0
.bss 22592 22592 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 345152 345152 0 0.0
.dynamic 624 624 0 0.0
.got 4936 4936 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 545973 545973 0 0.0
.text 9531813 9531813 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 10530796 10530796 0 0.0
(read/write) 496897 496897 0 0.0
.bss 40865 40865 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 392424 392424 0 0.0
.dynamic 560 560 0 0.0
.got 58608 58608 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 519932 519932 0 0.0
.text 8894788 8894788 0 0.0
lighting-app debug+rpc (read only) 2320089 2320089 0 0.0
(read/write) 128080 128080 0 0.0
.bss 50016 50016 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 70360 70360 0 0.0
.dynamic 608 608 0 0.0
.got 4304 4304 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 183121 183121 0 0.0
.text 1970306 1970306 0 0.0
lock-app debug (read only) 2146617 2146617 0 0.0
(read/write) 120312 120312 0 0.0
.bss 47808 47808 0 0.0
.data 1504 1504 0 0.0
.data.rel.ro 65416 65416 0 0.0
.dynamic 592 592 0 0.0
.got 4264 4264 0 0.0
.init 27 27 0 0.0
.init_array 720 720 0 0.0
.rodata 189441 189441 0 0.0
.text 1800034 1800034 0 0.0
ota-provider-app debug (read only) 2053193 2053193 0 0.0
(read/write) 115680 115680 0 0.0
.bss 48000 48000 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 60264 60264 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 632 632 0 0.0
.rodata 173595 173595 0 0.0
.text 1722210 1722210 0 0.0
ota-requestor-app debug (read only) 2084409 2084409 0 0.0
(read/write) 118488 118488 0 0.0
.bss 48672 48672 0 0.0
.data 1928 1928 0 0.0
.data.rel.ro 62296 62296 0 0.0
.dynamic 592 592 0 0.0
.got 4304 4304 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 169916 169916 0 0.0
.text 1755618 1755618 0 0.0
shell debug (read only) 2555305 2555305 0 0.0
(read/write) 150408 150408 0 0.0
.bss 67336 67336 0 0.0
.data 1360 1360 0 0.0
.data.rel.ro 76000 76000 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 215410 215410 0 0.0
.text 2177938 2177938 0 0.0
thermostat-no-ble arm64 (read only) 2362060 2362060 0 0.0
(read/write) 151185 151185 0 0.0
.bss 62897 62897 0 0.0
.data 1488 1488 0 0.0
.data.rel.ro 79040 79040 0 0.0
.dynamic 560 560 0 0.0
.got 4744 4744 0 0.0
.init 24 24 0 0.0
.init_array 368 368 0 0.0
.rodata 145164 145164 0 0.0
.text 1987712 1987712 0 0.0
tv-app debug (read only) 2839057 2839057 0 0.0
(read/write) 253392 253392 0 0.0
.bss 165944 165944 0 0.0
.data 4640 4640 0 0.0
.data.rel.ro 76600 76600 0 0.0
.dynamic 592 592 0 0.0
.got 4680 4680 0 0.0
.init 27 27 0 0.0
.init_array 912 912 0 0.0
.rodata 215371 215371 0 0.0
.text 2441154 2441154 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2410132 2410132 0 0.0
.bss 184996 184996 0 0.0
.data 5848 5848 0 0.0
.text 1372732 1372732 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1170635 1170635 0 0.0
bss 136264 136264 0 0.0
rodata 150076 150076 0 0.0
text 805648 805648 0 0.0
p6 all-clusters-app default (read/write) 2524680 2524680 0 0.0
.bss 118368 118368 0 0.0
.data 2784 2784 0 0.0
.text 1482944 1482944 0 0.0
light-app default (read/write) 2416416 2416416 0 0.0
.bss 111848 111848 0 0.0
.data 2584 2584 0 0.0
.text 1374680 1374680 0 0.0
lock-app default (read/write) 2420616 2420616 0 0.0
.bss 111648 111648 0 0.0
.data 2544 2544 0 0.0
.text 1378880 1378880 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 801096 801096 0 0.0
bss 69696 69696 0 0.0
noinit 40416 40416 0 0.0
text 570414 570414 0 0.0

@bzbarsky-apple
Copy link
Contributor Author

/rebase

People who need a raw buffer that they own should be calling
UnsafeRelease.  Get() should not have been made public.
@github-actions
Copy link

github-actions bot commented Apr 21, 2022

PR #17567: Size comparison from a297e4a to bb293ff

Increases (3 builds for efr32)
platform target config section a297e4a bb293ff change % change
efr32 lighting-app BRD4161A (read only) 905928 905944 16 0.0
.text 905920 905936 16 0.0
BRD4161A+rpc (read only) 940328 940344 16 0.0
.text 940320 940336 16 0.0
window-app BRD4161A (read only) 843416 843432 16 0.0
.text 843408 843424 16 0.0
Full report (32 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section a297e4a bb293ff change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 691003 691003 0 0.0
(read/write) 161924 161924 0 0.0
.bss 75912 75912 0 0.0
.data 3396 3396 0 0.0
.rodata 106043 106043 0 0.0
.text 584480 584480 0 0.0
lock-ftd LP_CC2652R7 (read only) 677367 677367 0 0.0
(read/write) 166528 166528 0 0.0
.bss 73936 73936 0 0.0
.data 3220 3220 0 0.0
.rodata 98807 98807 0 0.0
.text 578076 578076 0 0.0
lock-mtd LP_CC2652R7 (read only) 626111 626111 0 0.0
(read/write) 146732 146732 0 0.0
.bss 69656 69656 0 0.0
.data 3220 3220 0 0.0
.rodata 98687 98687 0 0.0
.text 526932 526932 0 0.0
pump-app LP_CC2652R7 (read only) 649171 649171 0 0.0
(read/write) 152500 152500 0 0.0
.bss 74368 74368 0 0.0
.data 3252 3252 0 0.0
.rodata 75379 75379 0 0.0
.text 573304 573304 0 0.0
pump-controller-app LP_CC2652R7 (read only) 642175 642175 0 0.0
(read/write) 151912 151912 0 0.0
.bss 74072 74072 0 0.0
.data 3216 3216 0 0.0
.rodata 78511 78511 0 0.0
.text 563176 563176 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 618154 618154 0 0.0
.app_xip_area 525160 525160 0 0.0
.bss 75652 75652 0 0.0
.data 692 692 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 613102 613102 0 0.0
.app_xip_area 521588 521588 0 0.0
.bss 74204 74204 0 0.0
.data 656 656 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 565722 565722 0 0.0
.app_xip_area 464620 464620 0 0.0
.bss 83496 83496 0 0.0
.data 568 568 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 905928 905944 16 0.0
(read/write) 129384 129384 0 0.0
.bss 127336 127336 0 0.0
.data 2044 2044 0 0.0
.text 905920 905936 16 0.0
BRD4161A+rpc (read only) 940328 940344 16 0.0
(read/write) 146064 146064 0 0.0
.bss 143816 143816 0 0.0
.data 2248 2248 0 0.0
.text 940320 940336 16 0.0
window-app BRD4161A (read only) 843416 843432 16 0.0
(read/write) 127472 127472 0 0.0
.bss 125512 125512 0 0.0
.data 1956 1956 0 0.0
.text 843408 843424 16 0.0
esp32 all-clusters-app c3devkit (read only) 985194 985194 0 0.0
(read/write) 1465954 1465954 0 0.0
.dram0.bss 62376 62376 0 0.0
.dram0.data 14428 14428 0 0.0
.flash.rodata 204696 204696 0 0.0
.flash.text 985194 985194 0 0.0
.iram0.text 62020 62020 0 0.0
m5stack (read only) 1040479 1040479 0 0.0
(read/write) 468112 468112 0 0.0
.dram0.bss 67896 67896 0 0.0
.dram0.data 34168 34168 0 0.0
.flash.rodata 234212 234212 0 0.0
.flash.text 1035095 1035095 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 684156 684156 0 0.0
.bss 77656 77656 0 0.0
.data 2000 2000 0 0.0
.text 598700 598700 0 0.0
lock k32w061+release (read/write) 725240 725240 0 0.0
.bss 78288 78288 0 0.0
.data 1960 1960 0 0.0
.text 639192 639192 0 0.0
linux all-clusters-app debug (read only) 2728681 2728681 0 0.0
(read/write) 149664 149664 0 0.0
.bss 59936 59936 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 81672 81672 0 0.0
.dynamic 608 608 0 0.0
.got 4448 4448 0 0.0
.init 27 27 0 0.0
.init_array 984 984 0 0.0
.rodata 233221 233221 0 0.0
.text 2320594 2320594 0 0.0
bridge-app debug+rpc (read only) 1842541 1842541 0 0.0
(read/write) 92016 92016 0 0.0
.bss 44136 44136 0 0.0
.data 3072 3072 0 0.0
.data.rel.ro 39744 39744 0 0.0
.dynamic 592 592 0 0.0
.got 3920 3920 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 148961 148961 0 0.0
.text 1574437 1574437 0 0.0
chip-tool debug (read only) 10916141 10916141 0 0.0
(read/write) 375120 375120 0 0.0
.bss 22592 22592 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 345152 345152 0 0.0
.dynamic 624 624 0 0.0
.got 4936 4936 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 546005 546005 0 0.0
.text 9531733 9531733 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 10530700 10530700 0 0.0
(read/write) 496897 496897 0 0.0
.bss 40865 40865 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 392424 392424 0 0.0
.dynamic 560 560 0 0.0
.got 58608 58608 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 519948 519948 0 0.0
.text 8894676 8894676 0 0.0
lighting-app debug+rpc (read only) 2320009 2320009 0 0.0
(read/write) 128080 128080 0 0.0
.bss 50016 50016 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 70360 70360 0 0.0
.dynamic 608 608 0 0.0
.got 4304 4304 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 183121 183121 0 0.0
.text 1970226 1970226 0 0.0
lock-app debug (read only) 2146521 2146521 0 0.0
(read/write) 120312 120312 0 0.0
.bss 47808 47808 0 0.0
.data 1504 1504 0 0.0
.data.rel.ro 65416 65416 0 0.0
.dynamic 592 592 0 0.0
.got 4264 4264 0 0.0
.init 27 27 0 0.0
.init_array 720 720 0 0.0
.rodata 189441 189441 0 0.0
.text 1799938 1799938 0 0.0
ota-provider-app debug (read only) 2053113 2053113 0 0.0
(read/write) 115680 115680 0 0.0
.bss 48000 48000 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 60264 60264 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 632 632 0 0.0
.rodata 173595 173595 0 0.0
.text 1722130 1722130 0 0.0
ota-requestor-app debug (read only) 2084329 2084329 0 0.0
(read/write) 118488 118488 0 0.0
.bss 48672 48672 0 0.0
.data 1928 1928 0 0.0
.data.rel.ro 62296 62296 0 0.0
.dynamic 592 592 0 0.0
.got 4304 4304 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 169916 169916 0 0.0
.text 1755538 1755538 0 0.0
shell debug (read only) 2555209 2555209 0 0.0
(read/write) 150408 150408 0 0.0
.bss 67336 67336 0 0.0
.data 1360 1360 0 0.0
.data.rel.ro 76000 76000 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 215410 215410 0 0.0
.text 2177842 2177842 0 0.0
thermostat-no-ble arm64 (read only) 2361964 2361964 0 0.0
(read/write) 151185 151185 0 0.0
.bss 62897 62897 0 0.0
.data 1488 1488 0 0.0
.data.rel.ro 79040 79040 0 0.0
.dynamic 560 560 0 0.0
.got 4744 4744 0 0.0
.init 24 24 0 0.0
.init_array 368 368 0 0.0
.rodata 145164 145164 0 0.0
.text 1987616 1987616 0 0.0
tv-app debug (read only) 2838985 2838985 0 0.0
(read/write) 253424 253424 0 0.0
.bss 165944 165944 0 0.0
.data 4640 4640 0 0.0
.data.rel.ro 76632 76632 0 0.0
.dynamic 592 592 0 0.0
.got 4680 4680 0 0.0
.init 27 27 0 0.0
.init_array 912 912 0 0.0
.rodata 215371 215371 0 0.0
.text 2441058 2441058 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2410132 2410132 0 0.0
.bss 184996 184996 0 0.0
.data 5848 5848 0 0.0
.text 1372732 1372732 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1170619 1170619 0 0.0
bss 136264 136264 0 0.0
rodata 150076 150076 0 0.0
text 805632 805632 0 0.0
p6 all-clusters-app default (read/write) 2524664 2524664 0 0.0
.bss 118368 118368 0 0.0
.data 2784 2784 0 0.0
.text 1482928 1482928 0 0.0
light-app default (read/write) 2416400 2416400 0 0.0
.bss 111848 111848 0 0.0
.data 2584 2584 0 0.0
.text 1374664 1374664 0 0.0
lock-app default (read/write) 2420600 2420600 0 0.0
.bss 111648 111648 0 0.0
.data 2544 2544 0 0.0
.text 1378864 1378864 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 801080 801080 0 0.0
bss 69696 69696 0 0.0
noinit 40416 40416 0 0.0
text 570400 570400 0 0.0

@bzbarsky-apple bzbarsky-apple merged commit e5922b3 into project-chip:master Apr 21, 2022
@bzbarsky-apple bzbarsky-apple deleted the make-Get-private branch April 21, 2022 16:02
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.

3 participants