compile-time-init-build
compile-time-init-build copied to clipboard
'msg::handler' interface: allow messages to pass by value
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.
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.
@lukevalenty Is this addressed by https://github.com/intel/compile-time-init-build/pull/615 ?
Yes, I think it is addressed by #615.