-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tlv] Optimize code size of processing context tags (#24224)
* [tlv] Encapsulate Tag encoding Make the internal representation of Tag private so that it is easier and safer to change it. Signed-off-by: Damian Krolik <[email protected]> * [tlv] Optimize code size of processing context tags TLV tag is represented as uint64_t that encodes the following components: - 16-bit vendor ID - 16-bit profile number - 32-bit tag number Context tags, which account for vast majority of tag usage in the SDK, are encoded as having both vendor ID and profile number equal to 0xFFFF. Anonymous tags are encoded in the same way, but using 0xFFFFFFFF tag number. This is correct because vendor IDs higher than 0xFFF0 shall not be assigned to real manufacturers, but constructing 0xFF... constants in hundreds of places adds non-negligible overhead to the flash usage. Encode profile ID in the negated form internally to optimize the code size when using special tags. * Fix build * Code review Signed-off-by: Damian Krolik <[email protected]>
- Loading branch information
1 parent
715a2bc
commit 5f3dda9
Showing
4 changed files
with
105 additions
and
62 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