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

Implement zero-cost, memcpy style serialization for C++ #315

Open
skeetsaz opened this issue Jul 14, 2023 · 1 comment
Open

Implement zero-cost, memcpy style serialization for C++ #315

skeetsaz opened this issue Jul 14, 2023 · 1 comment

Comments

@skeetsaz
Copy link
Contributor

Nunavut should code-generate C++ serialization functions that do a simple memcpy when possible. This would only be possible where the underlying architecture is compatible with the Cyphal serialization in certain ways (such as endianness, alignment, etc.) Also it may not be possible to do this with certain types of messages such as those that contain variable length arrays. In these cases the generated C++ uses std::vector or CETL VariableLengthArray and their memory layout would not match Cyphal's specified serialization due to having private bookkeeping members (allocator, capacity, size, max size.)

Perhaps it would also be good to provide some kind of DSDL annotation to assert that a message is compatible with zero-cost serialization. The goal would be for users to be able to say "Here's my carefully crafted set of DSDLs that I want to make sure are zero-cost. These other DSDL's I don't care if that's the case."

Here are some related Cyphal items with additional context:
#285
OpenCyphal/pydsdl#24

@pavel-kirienko
Copy link
Member

This is probably blocked on OpenCyphal/pydsdl#48

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

No branches or pull requests

2 participants