kvark / copyless

[deprecated] Avoid memcpy calls when working with standard containers
Apache License 2.0
276 stars 12 forks source link

Does not work with nested arrays #15

Open simon-auch opened 4 years ago

simon-auch commented 4 years ago

So I came across this while tinkering around on this. The essence is that when trying to create a box of [[0i32;SomeBigNumber];SomeBigNumber] the stack overflows, but when creating a box of [i32;SomeBigNumber*SomeBigNumber] it works.

I would understand if this is something this crate cannot change (as its a missed opportunity from the compiler to optimize this) but wanted to ask if there is a known specific reason for this to not work?

Minimal example

I'm using the latest nightly and of course use cargo run --release while testing this.

kvark commented 4 years ago

We don't have any introspection into the type, so we are at mercy of the Rust compiler, still. I don't know what we could do to support this case. Ideas are welcome!