D on quora ...

Paulo Pinto pjmlp at progtools.org
Mon Oct 16 14:24:57 UTC 2017


On Monday, 16 October 2017 at 14:14:50 UTC, Ola Fosheim Grøstad 
wrote:
> On Monday, 16 October 2017 at 13:49:50 UTC, Atila Neves wrote:
>> A std::shared_ptr going out of scope can pause the program for 
>> just as long as a GC mark-and-sweep.
>
> I don't use shared_ptr much, but why would a single shared_ptr 
> be that slow?

Cascade deletion of nested data structures, with the possibility 
of causing stack overflow.

Nicely presented by Herb Sutter on his CppCon 2016 talk, 
"Leak-Freedom in C++... By Default.", which presented a GC like 
implementation for C++, using deferred pointer.

https://www.youtube.com/watch?v=JfmTagWcqoE


More information about the Digitalmars-d mailing list