I don't think make_shared / make_unique is part of c++11 (and ceph is using 
that). It is part of c++14 I guess..

Thanks & Regards
Somnath

-----Original Message-----
From: Casey Bodley [mailto:cbod...@redhat.com] 
Sent: Thursday, December 03, 2015 7:17 AM
To: Sage Weil
Cc: Somnath Roy; Samuel Just (sam.j...@inktank.com); ceph-devel@vger.kernel.org
Subject: Re: queue_transaction interface + unique_ptr + performance

Hi,

To those writing benchmarks, please note that the standard library provides 
std::make_shared() as an optimization for shared_ptr. It creates the object and 
its shared storage in a single allocation, instead of the two allocations 
required for "std::shared_ptr<Foo> fs (new Foo())".

Casey

----- Original Message -----
> 1- I agree we should avoid shared_ptr whenever possible.
> 
> 2- unique_ptr should not have any more overhead than a raw 
> pointer--the compiler is enforcing the single-owner semantics.  See 
> for example
> 
>       https://msdn.microsoft.com/en-us/library/hh279676.aspx
> 
> "It is exactly is efficient as a raw pointer and can be used in STL 
> containers."
> 
> Unless the implementation is broken somehow?  That seems unlikely...
> 
> sage
> 
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" 
> in the body of a message to majord...@vger.kernel.org More majordomo 
> info at  http://vger.kernel.org/majordomo-info.html
> 

Reply via email to