Updates Types.fpp to use optimized sizes for enumerations#3956
Merged
LeStarch merged 1 commit intonasa:develfrom Jul 31, 2025
Merged
Updates Types.fpp to use optimized sizes for enumerations#3956LeStarch merged 1 commit intonasa:develfrom
Types.fpp to use optimized sizes for enumerations#3956LeStarch merged 1 commit intonasa:develfrom
Conversation
- Update enumerations in Types.fpp to use U8 instead of the default I32; the full I32 size is not needed for these simple enumerations
celskeggs
approved these changes
Jul 31, 2025
LeStarch
approved these changes
Jul 31, 2025
Collaborator
|
@bocchino could you weigh in on the use of an unsigned type as the enumeration backing type? Is this ok to do? |
thomas-bc
approved these changes
Jul 31, 2025
Collaborator
|
Yes, that seems fine. |
kyleajones
added a commit
to kyleajones/fprime
that referenced
this pull request
Aug 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
This change request modifies the enumeration size for all enums listed in
Types.fppfrom the default I32 type to the smaller U8 type.Rationale
This change will improve the memory footprint for telemetry channels that are defined by structs that contain members of types defined in this file. Particularly useful in memory-constrained systems that use F-Prime.
Testing/Review Recommendations
The change is straightforward. One review item worth considering would be using I8 instead of U8 as the type. In either case, all enums are well within the bounds of either type. I don't know if F-Prime has a preference to use the signed version of the type for these enums or if unsigned is fine.
Future Work
No planned future work associated with this issue.