4 ms·
Oh, it's also worth saying that only the `unlinked` method really has to be unsafe, since it's the root of any unsafety with this API. I chose to make the `_sha
by aturon 11y ago
Oh, it's also worth saying that only the `unlinked` method really has to be unsafe, since it's the root of any unsafety with this API. I chose to make the `_shared` methods unsafe as well because they present one of the ways that using `unlinked` could go wrong, but you could reduce the amount of unsafety to a single line in principle.
- aturon 11y agoAfter discussing idioms with a few others on the Rust team, I've pushed this refactoring, bringing the example down to a single use of `unsafe`. Feels much cleaner, and draws attention to `unlinked` as the source of unsafety here.
- bjz_ 11y agoHere is the commit for the benefit of others: https://github.com/aturon/crossbeam/commit/cc57af9e63a04013f1e47ff18961de9d588bef3f https://github.com/aturon/crossbeam/commit/cc57af9e63a04013f...