
25 May
2011
25 May
'11
8:22 p.m.
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