Hmm..Thanks Adam, so, one of the cleanups on the Ceph path could be to 
introduce make_shared..
We will come up with a prototype of optimized io path with removing unnecessary 
use of shared_ptr and see how much overall gain we are getting..

Thanks & Regards
Somnath

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

On 03/12/2015, Somnath Roy wrote:
> 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..

std::make_shared is in C++11, std::make_unique is in C++14. In addition to 
performance, std::make_shared is also more correct, in that:

  std::shared_ptr<T>(new T)

can leak object allocated by 'new T' if the allocation for the shared_ptr fails.

std::make_unique is nice for cleanliness and symmetry, but doesn't add anything 
for performance or safety. (Also you can write your own make_unique, where 
make_shared is intimately involved with the details of shared_ptr.)
--
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