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 unnecessary checking and casting of sizeof when we need uint16_t sizes #4997

Merged
merged 1 commit into from
Feb 25, 2021

Conversation

bzbarsky-apple
Copy link
Contributor

Compilers generate a constant for sizeof(), which converts cleanly to
whatever integer size we need as long as the constant is small enough.

Problem

We have extra complexity we do not need.

Summary of Changes

Remove the complexity.

…_t sizes.

Compilers generate a constant for sizeof(), which converts cleanly to
whatever integer size we need as long as the constant is small enough.
@github-actions
Copy link

Size increase report for "gn_qpg6100-example-build" from d48bcf2

File Section File VM
chip-qpg6100-lock-example.out .text -104 -104
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-qpg6100-lock-example.out and ./pull_artifact/chip-qpg6100-lock-example.out:

sections,vmsize,filesize
[Unmapped],0,104
.debug_aranges,0,-24
.debug_ranges,0,-24
.symtab,0,-32
.debug_frame,0,-52
.debug_abbrev,0,-83
.text,-104,-104
.debug_loc,0,-205
.debug_line,0,-237
.debug_info,0,-499


@andy31415 andy31415 merged commit 7e2a87a into project-chip:master Feb 25, 2021
@bzbarsky-apple bzbarsky-apple deleted the remove-sizeof-checks branch February 25, 2021 18:22
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