Re:Why Rust easily optimizes out smart pointers where C++ ca...
by kccqzy on Saturday June 04, 2022 @10:33PM
(#31627416)
It is a rookie mistake to wrap the result of new into a shared_ptr. It makes two heap allocations. You should use std::make_shared. It combines both and makes only one allocation.
[ Parent
| on HN ]
There are no comments on this comment yet.