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

Remove refcounting (reland of #3356) #3405

Merged

Conversation

mspang
Copy link
Contributor

@mspang mspang commented Oct 22, 2020

This needs a re-think; there are several problems currently:

  • refcounting of objects with static storage duration
  • refcounting of objects with automatic storage duration (stack objects)
  • refcounting of subobjects
    • including multiple base class subobjects (diamond inheritance)

The majority of current uses are in contexts where lifetime could not be
extended by reference counting and in general, the initial reference is
not dropped. The remaining case looks like a case of unique ownership.

If delegate interfaces really need to be refcounted, we'll need to ban
multiple inheritance of them (without resorting to virtual inheritance).

Reland with some #includes needed after #3397.

fixes #3348

This needs a re-think; there are several problems currently:

- refcounting of objects with static storage duration
- refcounting of objects with automatic storage duration (stack objects)
- refcounting of subobjects
  - including multiple base class subobjects (diamond inheritance)

The majority of current uses are in contexts where lifetime could not be
extended by reference counting and in general, the initial reference is
not dropped. The remaining case looks like a case of unique ownership.

If delegate interfaces really need to be refcounted, we'll need to ban
multiple inheritance of them (without resorting to virtual inheritance).

Reland with some #include needed after project-chip#3397.

fixes project-chip#3348
@github-actions
Copy link

Size increase report for "esp32-example-build"

File Section File VM
chip-wifi-echo.elf .dram0.bss 0 -8
chip-wifi-echo.elf .dram0.data -8 -8
chip-wifi-echo.elf .flash.text -232 -232
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-wifi-echo.elf and ./pull_artifact/chip-wifi-echo.elf:

sections,vmsize,filesize
[Unmapped],0,8
.xt.prop._ZN4chip8Encoding12LittleEndian7Write32ERPhj,0,-1
.dram0.bss,-8,0
.dram0.data,-8,-8
.debug_aranges,0,-16
.debug_ranges,0,-40
.xt.prop._ZN4chip8BufBound3PutEPKvj,0,-40
.xt.prop._ZN4chip9Transport19PeerConnectionStateC5Ev,0,-40
.debug_frame,0,-48
.xt.prop._ZN4chip16ReferenceCountedINS_28SecurePairingSessionDelegateENS_13DeleteDeletorIS1_EEE7ReleaseEv,0,-88
.xt.prop._ZN4chip16ReferenceCountedINS_9Transport4BaseENS_13DeleteDeletorIS2_EEE7ReleaseEv,0,-88
.symtab,0,-96
.strtab,0,-179
.flash.text,-232,-232
.debug_abbrev,0,-256
.shstrtab,0,-393
.debug_loc,0,-739
.debug_line,0,-1165
.debug_str,0,-2654
.debug_info,0,-4909


@github-actions
Copy link

Size increase report for "nrfconnect-example-build"

File Section File VM
chip-lock.elf [LOAD #3 [RW]] 0 27
chip-lock.elf datas -4 -4
chip-lock.elf devices -4 -4
chip-lock.elf bss 0 -27
chip-lock.elf text -448 -448
chip-lighting.elf [LOAD #3 [RW]] 0 23
chip-lighting.elf datas -4 -4
chip-lighting.elf devices -4 -4
chip-lighting.elf bss 0 -23
chip-lighting.elf text -448 -448
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-lock.elf and ./pull_artifact/chip-lock.elf:

sections,vmsize,filesize
[LOAD #3 [RW]],27,0
.shstrtab,0,3
datas,-4,-4
devices,-4,-4
bss,-27,0
.debug_aranges,0,-40
.symtab,0,-128
.debug_frame,0,-184
.strtab,0,-379
.debug_abbrev,0,-388
.debug_ranges,0,-432
text,-448,-448
.debug_line,0,-1374
.debug_loc,0,-1409
.debug_str,0,-4271
.debug_info,0,-9494

Comparing ./master_artifact/chip-lighting.elf and ./pull_artifact/chip-lighting.elf:

sections,vmsize,filesize
[LOAD #3 [RW]],23,0
.shstrtab,0,-1
datas,-4,-4
devices,-4,-4
bss,-23,0
.debug_aranges,0,-40
.symtab,0,-128
.debug_frame,0,-184
.strtab,0,-379
.debug_abbrev,0,-388
.debug_ranges,0,-432
text,-448,-448
.debug_line,0,-1374
.debug_loc,0,-1409
.debug_str,0,-4271
.debug_info,0,-9494

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize


@BroderickCarlin BroderickCarlin merged commit 5d99466 into project-chip:master Oct 26, 2020
mspang added a commit to mspang/connectedhomeip that referenced this pull request Oct 27, 2020
NetworkProvisioning::Init needs to initialize mDelegate to its
first argument.

This was dropped unintentionally in project-chip#3405
mspang added a commit to mspang/connectedhomeip that referenced this pull request Oct 27, 2020
NetworkProvisioning::Init needs to initialize mDelegate to its
first argument.

This was dropped unintentionally in project-chip#3405
andy31415 pushed a commit that referenced this pull request Oct 27, 2020
NetworkProvisioning::Init needs to initialize mDelegate to its
first argument.

This was dropped unintentionally in #3405
@mspang mspang deleted the for-chip/remove-unified-config2 branch April 2, 2021 00:53
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.

TestSecurePairingSession fails on linux_x64_gcc_mbedtls, but only on some machines
5 participants