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

fix: make r_device.fields a constant pointer #2421

Merged
merged 1 commit into from
Mar 13, 2023

Conversation

obones
Copy link
Contributor

@obones obones commented Mar 13, 2023

This allows for static "output_fields" to be stored in readonly memory on embedded architectures saving the very limited RAM available.
This saves about 7kB, representing 2.3% of the total installed RAM, which may not sound much but makes quite a difference for other parts of the program.

@zuckschwerdt
Copy link
Collaborator

The clang-format wants the asterisk to stick, e.g. static char const *const output_fields[] = {

@obones
Copy link
Contributor Author

obones commented Mar 13, 2023

Bummer, I did not notice any issue from the 5 actions that have run, I'll fix that

@zuckschwerdt
Copy link
Collaborator

I did once try to check/enforce clang-format, but we have too much "special formatting" in the code still. It's not checked for now. But the idea is to have it automated once some problems with .clang-format have been solved (i.e. clang-format should pass more code through unmodified and not e.g. change so many linebreaks and indents).

…t_fields" to be stored in readonly memory on embedded architectures
@obones
Copy link
Contributor Author

obones commented Mar 13, 2023

Thanks for the explanation about clang-format, I have learnt a new thing here.
I have amended the last commit, I believe this is now correct.

@zuckschwerdt zuckschwerdt merged commit ecb0b36 into merbanan:master Mar 13, 2023
andrewjw pushed a commit to andrewjw/rtl_433 that referenced this pull request Sep 29, 2023
Allows for static "output_fields" to be stored in readonly memory on embedded architectures.
@obones obones deleted the constant_device_fields branch October 3, 2023 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants