code-review for my smart-pointer
reddit.com·2d·
Discuss: r/rust
📌Pin/Unpin
Preview
Report Post

I've published a smart pointer to crate.io, based on our previous discussion (https://www.reddit.com/r/rust/comments/1pipj05/atomic_memory_ordering_confusion_can_atomic/). I think it might be okay now, but who knows.

Since the code is quite short, I'll post it here for convenience.

Edit: for bugs found by Consistent_Milk4660, I modified the code as following:

use std::{ cell::UnsafeCell, ops::Deref, sync::{ Arc, atomic::{self, AtomicI32, Ordering}, }, }; /// A smart pointer similar to `Arc<T>`, but allows `T` to be /// safely dropped early, providi...

Similar Posts

Loading similar posts...