Closed faern closed 9 years ago
I just realized the drop only drops the reference to the newly constructed slice. It never deallocates it. If I'm right then this PR introduces a memory leak.
Since thread::scoped
is now behind a feature gate until that problem gets resolved, I'm not in a rush to remove unstable dependencies yet. I'd also rather not abuse Vec
to get around the lack of a stable allocation API, which should be available by 1.0.
I wanted to remove the dependency to alloc since it's not allowed in beta. I replaced it with allocating a vector and taking an unsafe pointer into it. On drop I recreate a slice from that pointer and let it drop in the normal Rust way.
WARNING: I'm far from 100% sure this works the way I intend it to. I'm not totally sure what I have done here, but the tests seem to work. I have run both the tests in deque and in my projects depending on deque without problems.