4 ms·
Doesn't seem to be a problem, at least for Rust: https://godbolt.org/z/fToxz3d7a https://godbolt.org/z/fToxz3d7a. Functions with plain arguments and a struct b
by dicytea 1y ago
Doesn't seem to be a problem, at least for Rust: https://godbolt.org/z/fToxz3d7a https://godbolt.org/z/fToxz3d7a.
Functions with plain arguments and a struct both produce identical assembly output.
- carlos-menezes 1y agoC++ for reference: https://godbolt.org/z/7G6qxK6T8 https://godbolt.org/z/7G6qxK6T8
- hwpythonner 1y agoTry compiling with optimizations. I think by default this site doesn't add optimization flags. Here what happens with optimizations: https://godbolt.org/z/G18zd7chP https://godbolt.org/z/G18zd7chP Look at the registers usages vs stack
- carlos-menezes 1y agoGot it! Thanks for the link.
- physicsguy 1y agoIf you add a third argument you get different assembly
- airstrike 1y agoAlso worth noting clippy will warn about writing functions with too many arguments for the same reason listed in TFA https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments https://rust-lang.github.io/rust-clippy/master/index.html#to...