On Sat, Jun 29, 2013 at 5:29 PM, james <[email protected]> wrote:
> On 29/06/2013 18:39, Niko Matsakis wrote:
>
> if you were going to store the result on the caller's stack frame, the
> caller would have to know how much space to allocate! Conceivably one
>
>
> If you can have a function that returns an allocated iterator, can't you
> instead have
> a function that informs how big it would be, and a function that uses a
> passed in
> pointer from alloca?

We don't have alloca, but if we did, it would be less efficient than a
statically sized allocation since it would involve an extra stack size
check. A low-level, unsafe workaround like that isn't needed when you
can just have a function return an iterator of a specific type.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to