News for hackers. Stuff that matters.
Re:Great things about Rust that aren't just performance by kbolino on Sunday January 12, 2025 @03:04PM (#42676407)
It is only Arc and not Mutex that allocates and thus has "extra" pointer indirection. A Mutex can live perfectly well on the stack, as long as it outlives the threads accessing it. Arc has to allocate, because it is meant to outlive the function that created it, and the only place to safely do that is on the heap.

There are no comments on this comment yet.