Rc :: Arc = Box ::?

What, if anything, is a multi thread equiv of Box ?

What would the semantics be? For Rc and Arc, the difference is whether the multiple bindings sharing ownership to the same data can live on different threads. But Box owns its data exclusively, so there's nothing to be thread-unsafe here.

5 Likes

My answer would just be Box.

1 Like

With unstable allocator API Box<T, SomeUnsyncThreadLocalAllocator> can be considered as single threaded box.