kanal icon indicating copy to clipboard operation
kanal copied to clipboard

StackCell

Open DzenanJupic opened this issue 2 years ago • 3 comments

I couldn't stop thinking about how to maybe abstract all the unsafe stuff into a single module. This StackCell should be sound (maybe I made a mistake), and could potentially be used.

This is just a sketch though. Maybe I made a mistake, and the code is also not especially clean yet.

DzenanJupic avatar Oct 17 '22 00:10 DzenanJupic

It would be good if we could see a working prototype to test, then we can reshape the project around it.

fereidani avatar Oct 17 '22 12:10 fereidani

Some helpful links for people who are willing to help: https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md https://rust-unofficial.github.io/too-many-lists/fifth-stacked-borrows.html

fereidani avatar Oct 18 '22 06:10 fereidani

Actually, this solution isn't quite sound yet, since there's a mutable reference to the value on the stack. value has to be wrapped in an UnsafeCell, and we can only hold a shared reference to it. I don't have time for fixing the code or integrating it into the project right now but might get to it on one of the following evenings.

DzenanJupic avatar Oct 18 '22 11:10 DzenanJupic

No update for a long time, I'm closing the pull request, feel free to open a new issue if you got time to work on it.

fereidani avatar Nov 24 '22 03:11 fereidani