On 4/4/13 3:05 PM, Vadim wrote:
What's so confusing about this?  I agree that parameter modes had too
many options to think about, but this should be mostly transparent to
the user.    Perhaps to the programmer semantics should stay the same as
if parameter was truly passed by value (i.e. no de-referencing
needed).   The difference would be on the calling convention level.

I am thinking of how C++ fastcall calling convention handles function
arguments: anything that fits in 4 bytes is passed in registers,
otherwise it goes on stack.  Also, in cdecl convention small return
values go into EAX register, whereas large ones are copied directly into
the caller's stack frame via a hidden pointer parameter.   All this
completely transparent to the programmer (unless cross-language
libraries are involved, of course).

This is already done. The Rust ABI specifies that when large structures are passed by move, a pointer is implicitly passed instead.

Patrick

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to