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

Migrate System::Timer to BitMapObjectPool #11487

Merged
merged 1 commit into from
Nov 5, 2021

Conversation

kpschoedel
Copy link
Contributor

Problem

The multiple object pool implementations are being consolidated,
but System::Timer isn't ready.

Change overview

Transitionally, convert System::Timer to use BitMapObjectPool
instead of System::ObjectPool, so that it doesn't obstruct
refactoring.

Any platform using both System::Timer and
CHIP_SYSTEM_CONFIG_USE_HEAP will show a .bss increase from this PR;
this will be undone by a later step in pool conversion.

Testing

CI; no changes to functionality.

#### Problem

The multiple object pool implementations are being consolidated,
but `System::Timer` isn't ready.

#### Change overview

Transitionally, convert `System::Timer` to use `BitMapObjectPool`
instead of `System::ObjectPool`, so that it doesn't obstruct
refactoring.

Any platform using both `System::Timer` and
`CHIP_SYSTEM_CONFIG_USE_HEAP` will show a `.bss` increase from this PR;
this will be undone by a later step in pool conversion.

#### Testing

CI; no changes to functionality.
@github-actions
Copy link

github-actions bot commented Nov 5, 2021

PR #11487: Size comparison from 7addec8 to 475d4f6

Increases above 0.2%:

platform target config section 7addec8 475d4f6 change % change
linux all-clusters-app debug (read/write) 118656 119232 576 0.5
.bss 50000 50608 608 1.2
bridge-app debug+rpc (read/write) 69232 69808 576 0.8
.bss 34928 35536 608 1.7
chip-tool debug (read/write) 125864 126440 576 0.5
.bss 18128 18736 608 3.4
lighting-app debug+rpc (read/write) 102200 102776 576 0.6
.bss 40568 41176 608 1.5
ota-provider-app debug (read/write) 67400 67976 576 0.9
.bss 36992 37600 608 1.6
ota-requestor-app debug (read/write) 76656 77232 576 0.8
.bss 45120 45728 608 1.3
shell debug (read/write) 57608 58184 576 1.0
.bss 16040 16648 608 3.8
tv-app debug .bss 222640 223248 608 0.3
p6 all-clusters-app default .data 2520 2528 8 0.3
lock-app default .data 2392 2400 8 0.3
qpg lighting-app qpg6100+debug .data 1004 1008 4 0.4
lock-app qpg6100+debug .data 960 964 4 0.4
persistent-storage-app qpg6100+debug .bss 18912 19448 536 2.8
.data 356 360 4 1.1
Increases (36 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 7addec8 475d4f6 change % change
efr32 lighting-app BRD4161A (read only) 744880 744912 32 0.0
(read/write) 115708 115740 32 0.0
.bss 113932 113964 32 0.0
.data 1772 1776 4 0.2
.text 744872 744904 32 0.0
BRD4161A+rpc (read only) 732408 732456 48 0.0
(read/write) 132324 132364 40 0.0
.bss 130436 130468 32 0.0
.data 1888 1892 4 0.2
.text 732400 732448 48 0.0
lock-app BRD4161A (read only) 724160 724192 32 0.0
(read/write) 113524 113556 32 0.0
.bss 111788 111820 32 0.0
.data 1732 1736 4 0.2
.text 724152 724184 32 0.0
window-app BRD4161A (read only) 725072 725104 32 0.0
(read/write) 113844 113884 40 0.0
.bss 112108 112140 32 0.0
.data 1736 1740 4 0.2
.text 725064 725096 32 0.0
esp32 all-clusters-app c3devkit (read only) 882530 882534 4 0.0
(read/write) 1305960 1306000 40 0.0
.dram0.bss 57576 57608 32 0.1
.flash.rodata 198664 198672 8 0.0
.flash.text 882530 882534 4 0.0
m5stack (read/write) 423268 423296 28 0.0
.dram0.bss 60088 60112 24 0.0
.flash.rodata 204908 204912 4 0.0
k32w lighting-app k32w061+se05x+release (read/write) 699216 699276 60 0.0
.bss 77784 77808 24 0.0
.data 1904 1908 4 0.2
.text 613728 613760 32 0.0
lock-app k32w061+debug (read/write) 592036 592096 60 0.0
.bss 68316 68340 24 0.0
.data 1872 1876 4 0.2
.text 516048 516080 32 0.0
shell k32w061+debug (read/write) 657528 657576 48 0.0
.bss 78952 78980 28 0.0
.data 1840 1844 4 0.2
.text 570936 570952 16 0.0
linux all-clusters-app debug (read/write) 118656 119232 576 0.5
.bss 50000 50608 608 1.2
bridge-app debug+rpc (read/write) 69232 69808 576 0.8
.bss 34928 35536 608 1.7
chip-tool debug (read/write) 125864 126440 576 0.5
.bss 18128 18736 608 3.4
lighting-app debug+rpc (read/write) 102200 102776 576 0.6
.bss 40568 41176 608 1.5
ota-provider-app debug (read/write) 67400 67976 576 0.9
.bss 36992 37600 608 1.6
ota-requestor-app debug (read/write) 76656 77232 576 0.8
.bss 45120 45728 608 1.3
shell debug (read/write) 57608 58184 576 1.0
.bss 16040 16648 608 3.8
tv-app debug (read/write) 289824 290400 576 0.2
.bss 222640 223248 608 0.3
mbed all-clusters-app CY8CPROTO_062_4343W+release .bss 178892 178924 32 0.0
lighting-app CY8CPROTO_062_4343W+release .bss 171948 171980 32 0.0
.data 5568 5576 8 0.1
lock-app CY8CPROTO_062_4343W+release .bss 170844 170876 32 0.0
shell CY8CPROTO_062_4343W+release .bss 156224 156256 32 0.0
.data 4960 4968 8 0.2
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 861303 861335 32 0.0
bss 111256 111280 24 0.0
nrf52840dk_nrf52840+rpc (read/write) 823631 823679 48 0.0
bss 107608 107632 24 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 786326 786374 48 0.0
bss 112632 112652 20 0.0
text 507012 507016 4 0.0
lock-app nrf52840dk_nrf52840 (read/write) 838007 838039 32 0.0
bss 110292 110312 20 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 763306 763338 32 0.0
bss 111700 111724 24 0.0
pump-app nrf52840dk_nrf52840 (read/write) 844103 844135 32 0.0
bss 110428 110452 24 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 837863 837895 32 0.0
bss 110328 110348 20 0.0
shell nrf52840dk_nrf52840 (read/write) 775963 775995 32 0.0
bss 109080 109100 20 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 690986 691034 48 0.0
bss 110060 110084 24 0.0
p6 all-clusters-app default (read/write) 2300168 2300216 48 0.0
.bss 106840 106872 32 0.0
.data 2520 2528 8 0.3
.text 1258432 1258480 48 0.0
lock-app default (read/write) 2212872 2212920 48 0.0
.bss 95648 95680 32 0.0
.data 2392 2400 8 0.3
.text 1171136 1171184 48 0.0
qpg lighting-app qpg6100+debug (read only) 490604 490612 8 0.0
(read/write) 114140 114144 4 0.0
.bss 50944 50968 24 0.0
.data 1004 1008 4 0.4
.text 485284 485292 8 0.0
lock-app qpg6100+debug (read only) 466944 466952 8 0.0
.bss 49888 49912 24 0.0
.data 960 964 4 0.4
.text 461624 461632 8 0.0
persistent-storage-app qpg6100+debug (read only) 153212 153316 104 0.1
(read/write) 114140 114144 4 0.0
.bss 18912 19448 536 2.8
.data 356 360 4 1.1
.text 147892 147996 104 0.1
telink lighting-app tlsr9518adk80d (read/write) 662902 662966 64 0.0
bss 69072 69092 20 0.0
text 457992 458024 32 0.0
Decreases (18 builds for linux, mbed, nrfconnect, p6, qpg)
platform target config section 7addec8 475d4f6 change % change
linux all-clusters-app debug (read only) 1703617 1703409 -208 -0.0
.data.rel.ro 62336 62304 -32 -0.1
.text 1430962 1430802 -160 -0.0
bridge-app debug+rpc (read only) 1291605 1291413 -192 -0.0
.data.rel.ro 27768 27736 -32 -0.1
.text 1084725 1084581 -144 -0.0
chip-tool debug (read only) 4508917 4508725 -192 -0.0
.data.rel.ro 100096 100064 -32 -0.0
.text 4008629 4008485 -144 -0.0
lighting-app debug+rpc (read only) 1552617 1552425 -192 -0.0
.data.rel.ro 55168 55136 -32 -0.1
.text 1289426 1289282 -144 -0.0
ota-provider-app debug (read only) 1250841 1250649 -192 -0.0
.data.rel.ro 24568 24536 -32 -0.1
.text 1042514 1042370 -144 -0.0
ota-requestor-app debug (read only) 1329137 1328945 -192 -0.0
.data.rel.ro 25576 25544 -32 -0.1
.text 1106882 1106738 -144 -0.0
shell debug (read only) 787529 787337 -192 -0.0
.data.rel.ro 36816 36784 -32 -0.1
.text 608114 607970 -144 -0.0
tv-app debug (read only) 1816577 1816385 -192 -0.0
.data.rel.ro 58824 58792 -32 -0.1
.text 1519026 1518882 -144 -0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release .heap 852328 852296 -32 -0.0
lighting-app CY8CPROTO_062_4343W+release .heap 858928 858888 -40 -0.0
lock-app CY8CPROTO_062_4343W+release .heap 860040 860008 -32 -0.0
shell CY8CPROTO_062_4343W+release .heap 875264 875224 -40 -0.0
nrfconnect lock-app nrf52840dk_nrf52840 text 559040 559036 -4 -0.0
pump-controller-app nrf52840dk_nrf52840 text 558776 558772 -4 -0.0
shell nrf52840dk_nrf52840 text 519796 519792 -4 -0.0
p6 all-clusters-app default .heap 923984 923944 -40 -0.0
lock-app default .heap 935304 935264 -40 -0.0
qpg lock-app qpg6100+debug (read/write) 114144 114140 -4 -0.0
Full report (38 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 7addec8 475d4f6 change % change
efr32 lighting-app BRD4161A (read only) 744880 744912 32 0.0
(read/write) 115708 115740 32 0.0
.bss 113932 113964 32 0.0
.data 1772 1776 4 0.2
.text 744872 744904 32 0.0
BRD4161A+rpc (read only) 732408 732456 48 0.0
(read/write) 132324 132364 40 0.0
.bss 130436 130468 32 0.0
.data 1888 1892 4 0.2
.text 732400 732448 48 0.0
lock-app BRD4161A (read only) 724160 724192 32 0.0
(read/write) 113524 113556 32 0.0
.bss 111788 111820 32 0.0
.data 1732 1736 4 0.2
.text 724152 724184 32 0.0
window-app BRD4161A (read only) 725072 725104 32 0.0
(read/write) 113844 113884 40 0.0
.bss 112108 112140 32 0.0
.data 1736 1740 4 0.2
.text 725064 725096 32 0.0
esp32 all-clusters-app c3devkit (read only) 882530 882534 4 0.0
(read/write) 1305960 1306000 40 0.0
.dram0.bss 57576 57608 32 0.1
.dram0.data 16472 16472 0 0.0
.flash.rodata 198664 198672 8 0.0
.flash.text 882530 882534 4 0.0
.iram0.text 57624 57624 0 0.0
m5stack (read only) 913387 913387 0 0.0
(read/write) 423268 423296 28 0.0
.dram0.bss 60088 60112 24 0.0
.dram0.data 32108 32108 0 0.0
.flash.rodata 204908 204912 4 0.0
.flash.text 913387 913387 0 0.0
.iram0.text 125115 125115 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 699216 699276 60 0.0
.bss 77784 77808 24 0.0
.data 1904 1908 4 0.2
.text 613728 613760 32 0.0
lock-app k32w061+debug (read/write) 592036 592096 60 0.0
.bss 68316 68340 24 0.0
.data 1872 1876 4 0.2
.text 516048 516080 32 0.0
shell k32w061+debug (read/write) 657528 657576 48 0.0
.bss 78952 78980 28 0.0
.data 1840 1844 4 0.2
.text 570936 570952 16 0.0
linux all-clusters-app debug (read only) 1703617 1703409 -208 -0.0
(read/write) 118656 119232 576 0.5
.bss 50000 50608 608 1.2
.data 1042 1042 0 0.0
.data.rel.ro 62336 62304 -32 -0.1
.dynamic 592 592 0 0.0
.got 4088 4088 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 139189 139189 0 0.0
.text 1430962 1430802 -160 -0.0
bridge-app debug+rpc (read only) 1291605 1291413 -192 -0.0
(read/write) 69232 69808 576 0.8
.bss 34928 35536 608 1.7
.data 1568 1568 0 0.0
.data.rel.ro 27768 27736 -32 -0.1
.dynamic 592 592 0 0.0
.got 3952 3952 0 0.0
.init 27 27 0 0.0
.init_array 408 408 0 0.0
.rodata 110964 110964 0 0.0
.text 1084725 1084581 -144 -0.0
chip-tool debug (read only) 4508917 4508725 -192 -0.0
(read/write) 125864 126440 576 0.5
.bss 18128 18736 608 3.4
.data 2224 2224 0 0.0
.data.rel.ro 100096 100064 -32 -0.0
.dynamic 592 592 0 0.0
.got 4368 4368 0 0.0
.init 27 27 0 0.0
.init_array 432 432 0 0.0
.rodata 231824 231824 0 0.0
.text 4008629 4008485 -144 -0.0
lighting-app debug+rpc (read only) 1552617 1552425 -192 -0.0
(read/write) 102200 102776 576 0.6
.bss 40568 41176 608 1.5
.data 1170 1170 0 0.0
.data.rel.ro 55168 55136 -32 -0.1
.dynamic 608 608 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 129585 129585 0 0.0
.text 1289426 1289282 -144 -0.0
ota-provider-app debug (read only) 1250841 1250649 -192 -0.0
(read/write) 67400 67976 576 0.9
.bss 36992 37600 608 1.6
.data 752 752 0 0.0
.data.rel.ro 24568 24536 -32 -0.1
.dynamic 592 592 0 0.0
.got 4016 4016 0 0.0
.init 27 27 0 0.0
.init_array 448 448 0 0.0
.rodata 112200 112200 0 0.0
.text 1042514 1042370 -144 -0.0
ota-requestor-app debug (read only) 1329137 1328945 -192 -0.0
(read/write) 76656 77232 576 0.8
.bss 45120 45728 608 1.3
.data 816 816 0 0.0
.data.rel.ro 25576 25544 -32 -0.1
.dynamic 592 592 0 0.0
.got 3992 3992 0 0.0
.init 27 27 0 0.0
.init_array 520 520 0 0.0
.rodata 124176 124176 0 0.0
.text 1106882 1106738 -144 -0.0
shell debug (read only) 787529 787337 -192 -0.0
(read/write) 57608 58184 576 1.0
.bss 16040 16648 608 3.8
.data 242 242 0 0.0
.data.rel.ro 36816 36784 -32 -0.1
.dynamic 592 592 0 0.0
.got 3528 3528 0 0.0
.init 27 27 0 0.0
.init_array 344 344 0 0.0
.rodata 77903 77903 0 0.0
.text 608114 607970 -144 -0.0
tv-app debug (read only) 1816577 1816385 -192 -0.0
(read/write) 289824 290400 576 0.2
.bss 222640 223248 608 0.3
.data 2704 2704 0 0.0
.data.rel.ro 58824 58792 -32 -0.1
.dynamic 592 592 0 0.0
.got 4408 4408 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 155240 155240 0 0.0
.text 1519026 1518882 -144 -0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2291408 2291408 0 0.0
.bss 178892 178924 32 0.0
.data 5224 5224 0 0.0
.heap 852328 852296 -32 -0.0
.text 1254008 1254008 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2271568 2271568 0 0.0
.bss 171948 171980 32 0.0
.data 5568 5576 8 0.1
.heap 858928 858888 -40 -0.0
.text 1234168 1234168 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2249224 2249224 0 0.0
.bss 170844 170876 32 0.0
.data 5560 5560 0 0.0
.heap 860040 860008 -32 -0.0
.text 1211824 1211824 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139744 1139744 0 0.0
.bss 11752 11752 0 0.0
.data 4368 4368 0 0.0
.heap 1020328 1020328 0 0.0
.text 103128 103128 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2048464 2048464 0 0.0
.bss 156224 156256 32 0.0
.data 4960 4968 8 0.2
.heap 875264 875224 -40 -0.0
.text 1011064 1011064 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 861303 861335 32 0.0
bss 111256 111280 24 0.0
rodata 96872 96872 0 0.0
text 577556 577556 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 823631 823679 48 0.0
bss 107608 107632 24 0.0
rodata 88048 88048 0 0.0
text 551704 551704 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 786326 786374 48 0.0
bss 112632 112652 20 0.0
rodata 92128 92128 0 0.0
text 507012 507016 4 0.0
lock-app nrf52840dk_nrf52840 (read/write) 838007 838039 32 0.0
bss 110292 110312 20 0.0
rodata 93240 93240 0 0.0
text 559040 559036 -4 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 763306 763338 32 0.0
bss 111700 111724 24 0.0
rodata 88548 88548 0 0.0
text 488588 488588 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497323 497323 0 0.0
bss 51824 51824 0 0.0
rodata 45776 45776 0 0.0
text 339436 339436 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 844103 844135 32 0.0
bss 110428 110452 24 0.0
rodata 94952 94952 0 0.0
text 563200 563200 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 837863 837895 32 0.0
bss 110328 110348 20 0.0
rodata 93240 93240 0 0.0
text 558776 558772 -4 -0.0
shell nrf52840dk_nrf52840 (read/write) 775963 775995 32 0.0
bss 109080 109100 20 0.0
rodata 72496 72496 0 0.0
text 519796 519792 -4 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 690986 691034 48 0.0
bss 110060 110084 24 0.0
rodata 67140 67140 0 0.0
text 440388 440388 0 0.0
p6 all-clusters-app default (read/write) 2300168 2300216 48 0.0
.bss 106840 106872 32 0.0
.data 2520 2528 8 0.3
.heap 923984 923944 -40 -0.0
.text 1258432 1258480 48 0.0
lock-app default (read/write) 2212872 2212920 48 0.0
.bss 95648 95680 32 0.0
.data 2392 2400 8 0.3
.heap 935304 935264 -40 -0.0
.text 1171136 1171184 48 0.0
qpg lighting-app qpg6100+debug (read only) 490604 490612 8 0.0
(read/write) 114140 114144 4 0.0
.bss 50944 50968 24 0.0
.data 1004 1008 4 0.4
.text 485284 485292 8 0.0
lock-app qpg6100+debug (read only) 466944 466952 8 0.0
(read/write) 114144 114140 -4 -0.0
.bss 49888 49912 24 0.0
.data 960 964 4 0.4
.text 461624 461632 8 0.0
persistent-storage-app qpg6100+debug (read only) 153212 153316 104 0.1
(read/write) 114140 114144 4 0.0
.bss 18912 19448 536 2.8
.data 356 360 4 1.1
.text 147892 147996 104 0.1
telink lighting-app tlsr9518adk80d (read/write) 662902 662966 64 0.0
bss 69072 69092 20 0.0
noinit 33216 33216 0 0.0
text 457992 458024 32 0.0

@andy31415 andy31415 merged commit 12fbf58 into project-chip:master Nov 5, 2021
@kpschoedel kpschoedel deleted the x11428-timers branch November 9, 2021 14:23
kpschoedel added a commit to kpschoedel/connectedhomeip that referenced this pull request Nov 11, 2021
#### Problem

We have too many pool allocators.

Previous PRs (project-chip#11428, project-chip#11487) transitionally use `BitMapObjectPool`
where previously `System::ObjectPool` had been used, but this lost
the ability to configure heap allocation.

#### Change overview

- Add a heap allocator (from project-chip#9590)
- Add allocation selection (from project-chip#11371)
- Use this for `System::Timer` (complementing project-chip#11487)

Co-authored-by: Zang MingJie <zealot0630@gmail.com>
Co-authored-by: C Freeman <cecille@google.com>

A future PR will use this for Inet pools (complementing project-chip#11428);
that is not done here because it would conflict with other Inet
changes under way.

#### Testing

CI; no changes to functionality.

CI should show `.bss` decreases corresponding to increases in project-chip#11487.
kpschoedel added a commit to kpschoedel/connectedhomeip that referenced this pull request Nov 11, 2021
#### Problem

We have too many pool allocators.

Previous PRs (project-chip#11428, project-chip#11487) transitionally use `BitMapObjectPool`
where previously `System::ObjectPool` had been used, but this lost
the ability to configure heap allocation.

#### Change overview

- Add a heap allocator (from project-chip#9590)
- Add allocation selection (from project-chip#11371)
- Use this for `System::Timer` (complementing project-chip#11487)

Co-authored-by: Zang MingJie <zealot0630@gmail.com>
Co-authored-by: C Freeman <cecille@google.com>

A future PR will use this for Inet pools (complementing project-chip#11428);
that is not done here because it would conflict with other Inet
changes under way.

#### Testing

Added heap versions of unit tests in TestPool. (A future PR will add
`System::Object`-style statistics and re-unify most of these tests.)

CI should show `.bss` decreases corresponding to increases in project-chip#11487.
kpschoedel added a commit to kpschoedel/connectedhomeip that referenced this pull request Nov 15, 2021
#### Problem

We have too many pool allocators.

Previous PRs (project-chip#11428, project-chip#11487) transitionally use `BitMapObjectPool`
where previously `System::ObjectPool` had been used, but this lost
the ability to configure heap allocation.

#### Change overview

- Add a heap allocator (from project-chip#9590)
- Add allocation selection (from project-chip#11371)
- Use this for `System::Timer` (complementing project-chip#11487)

Co-authored-by: Zang MingJie <zealot0630@gmail.com>
Co-authored-by: C Freeman <cecille@google.com>

A future PR will use this for Inet pools (complementing project-chip#11428);
that is not done here because it would conflict with other Inet
changes under way.

#### Testing

Added heap versions of unit tests in TestPool. (A future PR will add
`System::Object`-style statistics and re-unify most of these tests.)

CI should show `.bss` decreases corresponding to increases in project-chip#11487.
kpschoedel added a commit to kpschoedel/connectedhomeip that referenced this pull request Nov 16, 2021
#### Problem

We have too many pool allocators.

Previous PRs (project-chip#11428, project-chip#11487) transitionally use `BitMapObjectPool`
where previously `System::ObjectPool` had been used, but this lost
the ability to configure heap allocation.

#### Change overview

- Add a heap allocator (from project-chip#9590)
- Add allocation selection (from project-chip#11371)
- Use this for `System::Timer` (complementing project-chip#11487)

Co-authored-by: Zang MingJie <zealot0630@gmail.com>
Co-authored-by: C Freeman <cecille@google.com>

A future PR will use this for Inet pools (complementing project-chip#11428);
that is not done here because it would conflict with other Inet
changes under way.

#### Testing

Added heap versions of unit tests in TestPool. (A future PR will add
`System::Object`-style statistics and re-unify most of these tests.)

CI should show `.bss` decreases corresponding to increases in project-chip#11487.
kpschoedel added a commit to kpschoedel/connectedhomeip that referenced this pull request Nov 16, 2021
#### Problem

We have too many pool allocators.

Previous PRs (project-chip#11428, project-chip#11487) transitionally use `BitMapObjectPool`
where previously `System::ObjectPool` had been used, but this lost
the ability to configure heap allocation.

#### Change overview

- Add a heap allocator (from project-chip#9590)
- Add allocation selection (from project-chip#11371)
- Use this for `System::Timer` (complementing project-chip#11487)

Co-authored-by: Zang MingJie <zealot0630@gmail.com>
Co-authored-by: C Freeman <cecille@google.com>

A future PR will use this for Inet pools (complementing project-chip#11428);
that is not done here because it would conflict with other Inet
changes under way.

#### Testing

Added heap versions of unit tests in TestPool. (A future PR will add
`System::Object`-style statistics and re-unify most of these tests.)

CI should show `.bss` decreases corresponding to increases in project-chip#11487.
kpschoedel added a commit that referenced this pull request Nov 19, 2021
#### Problem

We have too many pool allocators.

Previous PRs (#11428, #11487) transitionally use `BitMapObjectPool`
where previously `System::ObjectPool` had been used, but this lost
the ability to configure heap allocation.

#### Change overview

- Add a heap allocator (from #9590)
- Add allocation selection (from #11371)
- Use this for `System::Timer` (complementing #11487)

- Factor out common code.
- Use a heap-allocated list to track heap-allocated objects.
- More unit tests.

Co-authored-by: Zang MingJie <zealot0630@gmail.com>
Co-authored-by: C Freeman <cecille@google.com>

A future PR will use this for Inet pools (complementing #11428);
that is not done here because it would conflict with other Inet
changes under way.

#### Testing

Added heap versions of unit tests in TestPool. (A future PR will add
`System::Object`-style statistics and re-unify most of these tests.)

CI should show `.bss` decreases corresponding to increases in #11487.
PSONALl pushed a commit to PSONALl/connectedhomeip that referenced this pull request Dec 3, 2021
#### Problem

The multiple object pool implementations are being consolidated,
but `System::Timer` isn't ready.

#### Change overview

Transitionally, convert `System::Timer` to use `BitMapObjectPool`
instead of `System::ObjectPool`, so that it doesn't obstruct
refactoring.

Any platform using both `System::Timer` and
`CHIP_SYSTEM_CONFIG_USE_HEAP` will show a `.bss` increase from this PR;
this will be undone by a later step in pool conversion.

#### Testing

CI; no changes to functionality.
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