Boost logo

Boost Users :

Subject: Re: [Boost-users] why is make_shared using so much of my stack....?
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2011-02-09 10:34:41


On Sunday, February 06, 2011, Krzysztof Czainski wrote:
> 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)?

https://svn.boost.org/trac/boost/ticket/4256

I think to fix it would require adding a special shared_ptr constructor for
make_shared to use, which default constructs the deleter instead of copying
the deleter in as a constructor argument.




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net