[webkit-dev] std::shared_ptr?

2013-10-26 Thread Brendan Long
On 10/25/2013 06:38 PM, Darin Adler wrote: We are replacing PassOwnPtr and OwnPtr with std::unique_ptr. This is part of a general trend where we are adopting some C++11 language and library features. Is there any plan to replace RefPtr with std::shared_ptr too, or is there some reason why that

Re: [webkit-dev] std::shared_ptr?

2013-10-26 Thread Ryosuke Niwa
I don't think we can afford to use shared_ptr. As far as I know, it allocates a new memory space for each object to be shared. Doing that for every DOM node will probably be prohibitively expensive. - R. Niwa On Sat, Oct 26, 2013 at 11:16 AM, Brendan Long s...@brendanlong.com wrote: On

Re: [webkit-dev] std::shared_ptr?

2013-10-26 Thread Brendan Long
One of the answers on this Stack Overflow question http://stackoverflow.com/questions/3628081/shared-ptr-horrible-speed suggests that we can fix the memory issue by using `making_shared`: *use* |make_shared| http://en.cppreference.com/w/cpp/memory/shared_ptr/make_shared *to allocate them*,

Re: [webkit-dev] std::shared_ptr?

2013-10-26 Thread Benjamin Poulain
On 10/26/13, 8:51 PM, Brendan Long wrote: One of the answers on this Stack Overflow question http://stackoverflow.com/questions/3628081/shared-ptr-horrible-speed suggests that we can fix the memory issue by using `making_shared`: *use* |make_shared|