2011/2/6 Christopher Jefferson <chris@bubblescope.net>
boost::detail::sp_ms_deleter<test>
Is as big as test, and make_shared allocates one of those on the stack, in line:
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
Chris
This looks like a very interesting drawback of make_shared, that never occoured to me. The deleter contains space for the allocated object inside itself, and is passed by value, therefore the allocated object must be small enough to fit on the stack, when using make_shared.
Is this a known thing (bug)?
Regards, Kris.