On 11/8/13 3:13 PM, Igor Bukanov wrote:
On 9 November 2013 00:08, Huon Wilson <[email protected]> wrote:
`&T` is pointer-sized but `T` isn't always.

If the size of &T is not known, then obviously such optimization is
not applicable, The point is about &T where T is fixed-sized 1-4 word
thing.


(I believe that LLVM will optimise references to pass-by-value in certain
circumstances; presumably when functions are internal to a compilation
unit.)

But what about declaring that such optimization is always valid and
even require it on the level of ABI?

I don't see how you can without defeating separate compilation. If I am a function:

    fn f(s: ~str) {}

It is `f`'s responsibility to free `s` at the end. That can't be done if this optimization has been performed.

Patrick

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to