Update: The approach sketched earlier does not work out because it is
possible for a function to take a parameterized type without the
caller knowing that it does. (For example, a fn<T>(x: fn(T)), when
given a function fn(int), will call it with the argument given by
reference, since it sees it as type T, whereas the function will
expect it by value.)

The only sane solution seems to be to pass everything by reference.
This sound awful but, for some obscure reason, actually shrinks our
(optimized) compiler by 124k. This suggests that llvm wasn't being
very clever about eliminiating allocas anyway.

So I'm going to continue exploring this idea. Will come back with
benchmarks when available.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to