On Sat, Jun 1, 2013 at 7:47 AM, Matthieu Monrocq <[email protected]
> wrote:

>
>  1. Futures use a custom free-list allocator for performance.
>>>
>>
> I don't see why Futures could not be allocated on the stack ?
>
> Since Rust is move aware and has value types, it seems to me this should
> be possible.
>

Because I/O manager needs to know where that future is in order to fill in
the result.

Perhaps it's possible to have a stack-allocated future objects that consist
of just a raw pointer to a block owned by the I/O manager.  But these would
need to have by-move semantics in order to emulate behavior of unique
pointers.   I am not entirely sure how by-move vs by-copy is decided, but
according to 
this<http://static.rust-lang.org/doc/rust.html#moved-and-copied-types>Rust
would choose by-copy.

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

Reply via email to