On 12/26/2016 04:45 PM, Thiago Macieira wrote:

Do you have any papers that show the advantage of the different possibilities?
On modern CPU architectures.

There is an objective comparison here:
http://stackoverflow.com/questions/2598089/alternative-for-garbage-collector

But the most popular answer is not true regarding reference counters because shared_ptr uses atomic reference increment / decrement for most processors.

Here's an interesting benchmark comparing shared_ptr with raw pointers:
http://blog.davidecoppola.com/2016/10/performance-of-raw-pointers-vs-smart-pointers-in-cpp/

Keep in mind that "shared_ptr's allocate_shared" is faster than "make_shared" and root_ptr is as fast as "shared_ptr's allocate_shared".

Also for the C++ programmers out there: root_ptr abstracts more elegantly inheritances than shared_ptr, intrusive_ptr, etc.

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to