Skip to content

Added custom aliaser for shared_ptr messages.#64

Merged
dallison merged 1 commit intodallison:mainfrom
mikael-s-persson:feature/msg_aliasing
May 1, 2026
Merged

Added custom aliaser for shared_ptr messages.#64
dallison merged 1 commit intodallison:mainfrom
mikael-s-persson:feature/msg_aliasing

Conversation

@mikael-s-persson
Copy link
Copy Markdown
Collaborator

Added custom aliaser for shared_ptr messages.

This is basically to support using the shared_ptr directly when trying to tie together the ref-counting/life-time of active-messages with a zero-copy message type that aliases the message memory in some non-trivial way (not just a reinterpret-cast).

The only change for prior behavior is the static assert and sizeof assert on what was originally a blind reinterpret_cast to provide at least some minimal checks against UB.

One question is whether it's worth doing a similar mechanism on the publishing side. But that can be a lot trickier (reallocations and all that), while being much easier to do manually (no need for ref-counting and all that). So, I'm leaning towards not doing it on that side of things.

@dallison dallison merged commit ddd1e9a into dallison:main May 1, 2026
3 checks passed
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