Skip to content

Inline coding of 0-length messages#39

Merged
tridge merged 2 commits intodronecan:masterfrom
tpwrules:pr/inline-etc
Mar 23, 2026
Merged

Inline coding of 0-length messages#39
tridge merged 2 commits intodronecan:masterfrom
tpwrules:pr/inline-etc

Conversation

@tpwrules
Copy link
Copy Markdown
Contributor

Also allows future optimizations.

Tested that ArduPilot master (bbd1d94d4) quadplane-can SITL frame still flies.

This allows the entry point to be inlined at the caller site, paving the
way for various optimizations.

<msg>_encode now calls the non-inlined _<msg>_encode function in the .c
file which does the preliminary work then calls __<msg>_encode to encode
the actual type, if compound (or e.g. canardEncodeScalar).
Allows the processing of 0-length messages (which is true of some
important ones in the DSDL) to be optimized away.
@tpwrules tpwrules requested a review from tridge March 23, 2026 20:54
@tridge
Copy link
Copy Markdown
Member

tridge commented Mar 23, 2026

@tpwrules can you explain what the advantage is? Does this save flash space?

@tridge tridge merged commit 431170f into dronecan:master Mar 23, 2026
3 checks passed
@tpwrules
Copy link
Copy Markdown
Contributor Author

Yes, it saves a bit, but it is also a prerequisite for table coding.

@tpwrules tpwrules deleted the pr/inline-etc branch March 23, 2026 21:02
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.

2 participants