-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pw_protobuf: Disambiguate maximum size constants
pw_protobuf messages define a `kMaxEncodedSizeBytes` constant to help users with buffer sizing. However, this constant did not truly represent the message's maximum size in cases where field sizes were unknown, which could easily result in bugs when these constants were blindly trusted (there were instances of this in pw_protobuf's own unit tests). This changes the code generator to rename this constants to `kMaxEncodedSizeBytesWithoutValues`, better describing its actual function. The original definition of `kMaxEncodedSizeBytes` is kept temporarily to allow projects to migrate to the new constant. In a follow-up change, `kMaxEncodedSizeBytes` will only be generated if the size of every field in a message struct is statically known. Bug: 379868242 Change-Id: I212ca327529d3b679cdc7757ca759eb6a87847d1 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/259012 Commit-Queue: Alexei Frolov <[email protected]> Lint: Lint 🤖 <[email protected]> Reviewed-by: Armando Montanez <[email protected]>
- Loading branch information
Showing
8 changed files
with
220 additions
and
110 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.