3 ms·
Let's disregard inlining etc, so that we have actual function calls in both languages. C and Rust compilers do the same thing - they follow a calling conventio
by kzrdude 7y ago
Let's disregard inlining etc, so that we have actual function calls in both languages.
C and Rust compilers do the same thing - they follow a calling convention. It will tell you how to pass a struct, if it should be passed as a pointer or in registers etc.
- richardwhiuk 7y agoRust doesn't have a defined, standardized, binary calling convention, to the extent that C does.
- kzrdude 7y agoI agree, but that doesn't mean that it picks different calling conventions for each function call it compiles or something like that. Each version & platform of Rustc will have a calling convention that it sticks to when compiling function calls.
- richardwhiuk 7y agoIt can pick a calling style on a per function basis.