$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [boost] [Block Pointer] benchmark
From: Phil Bouchard (philippe_at_[hidden])
Date: 2011-05-25 16:22:49
On 5/25/2011 12:18 PM, Nevin Liber wrote:
>
> Is it copying anything more than a pointer? Are you really asserting that
> copying a pointer is far more work than a heap allocation?? Could you post
> some assembly on any platform backing your assertion?
So we have shared_ptr being initialized with an object created by
operator new. shared_ptr will then allocate another reference counter.
2 allocations is faster than the make_shared counterpart so yes
copying a pointer is slower than 2 heap allocations.
-Phil