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

'msg::handler' interface: allow messages to pass by value #457

Open
lukevalenty opened this issue Dec 23, 2023 · 1 comment
Open

'msg::handler' interface: allow messages to pass by value #457

lukevalenty opened this issue Dec 23, 2023 · 1 comment

Comments

@lukevalenty
Copy link
Contributor

lukevalenty commented Dec 23, 2023

Some embedded architectures, ABIs, message sizes, and compilers may benefit from passing messages by value rather than reference.

For example, in-order RISC processors that can pass the entire message struct by value in registers are a good candidate.

This saves storing the message to memory and retrieving it from memory for each callback.

Benchmarking pass-by-reference vs pass-by-value for an individual use case will still be useful to determine which option is better for that use case.

@elbeno
Copy link
Contributor

elbeno commented May 21, 2024

Clang has the builtin function __can_pass_in_regs(type) which might be useful, but I don't know if there is a similar intrinsic for GCC or whether it is widely applicable.

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