I have an application that passes around a lot of Arc<dyn Whatever>, and many of the traits have do-nothing or default implementations on a zero-sized type that can be used in a lot of cases.
Unfortunately, Arc<T>::new allocates heap memory even when T is zero-sized and doesn't need Drop.
Before I go making my own, is there a common crate that can optimize the construction of real std::Arcs for these kinds of ZSTs so I don't have to suffer a heap allocation for each one?
1 post - 1 participant
