
6 Apr
2011
6 Apr
'11
6:07 p.m.
AMDG On 04/06/2011 10:54 AM, Nevin Liber wrote:
2011/4/6 Юрій Зубрицький<mt.wizard@gmail.com>
Actually, boost::make_shared involves one dynamic_cast operation (when getting deleter from shared_ptr object), that's why it doesn't perform faster at all
Where exactly is that in the code? I don't see it in make_shared.hpp (1.46.1), and the uses inside shared_ptr.hpp look to be related to construction and dynamic_pointer_cast.
I assume that he's referring to the call to get_deleter. It doesn't actually do a dynamic_cast. It does a single type_info comparison.
I also surmise that dynamic_cast is still faster than heap allocation.
In Christ, Steven Watanabe