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

Allow passing FixedSpan to TLVWriter::Put. #8294

Merged

Conversation

bzbarsky-apple
Copy link
Contributor

Two main changes here:

  1. Narrow down the existing Put template for enums to only get matched
    for enum types, so it does not try to get compiled for a FixedSpan.

  2. Introduce more inter-conversions between Span and FixedSpan, where
    possible, via implicit constructors.

Problem

Can't Put a FixedSpan, so people hand-write the data() and size() bits.

Change overview

See above.

Testing

Passes unit tests, and I can now pass a FixedSpan to TLVWriter::Put (in a different PR).

@github-actions
Copy link

Size increase report for "esp32-example-build" from 47823f1

File Section File VM
chip-temperature-measurement-app.elf .flash.text -60 -60
chip-lock-app.elf .flash.text 64 64
chip-shell.elf .flash.text 4 4
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-persistent-storage.elf and ./pull_artifact/chip-persistent-storage.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-temperature-measurement-app.elf and ./pull_artifact/chip-temperature-measurement-app.elf:

sections,vmsize,filesize
[Unmapped],0,60
.debug_line,0,2
.debug_str,0,2
.flash.text,-60,-60

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize
.debug_str,0,7
.debug_line,0,1
.debug_loc,0,-16

Comparing ./master_artifact/chip-pigweed-app.elf and ./pull_artifact/chip-pigweed-app.elf:

sections,vmsize,filesize

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

sections,vmsize,filesize
.flash.text,64,64
.debug_line,0,2
.debug_str,0,2
.debug_loc,0,-48
[Unmapped],0,-64

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

sections,vmsize,filesize
.flash.text,4,4
.debug_str,0,3
.debug_line,0,1
[Unmapped],0,-4


src/lib/support/Span.h Outdated Show resolved Hide resolved
src/lib/support/Span.h Show resolved Hide resolved
Two main changes here:

1. Narrow down the existing Put template for enums to only get matched
for enum types, so it does not try to get compiled for a FixedSpan.

2. Introduce more inter-conversions between Span and FixedSpan, where
possible, via implicit constructors.
@bzbarsky-apple
Copy link
Contributor Author

@bzbarsky-apple bzbarsky-apple merged commit c76a376 into project-chip:master Jul 14, 2021
@bzbarsky-apple bzbarsky-apple deleted the more-span-facilities branch July 14, 2021 01:55
nikita-s-wrk pushed a commit to nikita-s-wrk/connectedhomeip that referenced this pull request Sep 23, 2021
Two main changes here:

1. Narrow down the existing Put template for enums to only get matched
for enum types, so it does not try to get compiled for a FixedSpan.

2. Introduce more inter-conversions between Span and FixedSpan, where
possible, via implicit constructors.
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.

6 participants