[Webkit-unassigned] [Bug 205617] Add makeRefCounted<>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 2 07:09:02 PST 2020


--- Comment #6 from Anders Carlsson <andersca at apple.com> ---
(In reply to Antti Koivisto from comment #5)
> I'm not convinced that the public constructor would be a problem in practice.

I agree.

> Accidentally stack-allocating refcounted objects and then passing them via
> RefPtrs seems bit far fetched, makeUnique could static_assert that the type
> is not RefCounted, and direct new/delete is effectively banned already.

It seems like stack-allocating RefCounted would already ASSERT on destruction due to the m_adoptionIsRequired checks in place.

> That's why I'd prefer the simplest macro-free solution.

Again, I agree.

That said, shouldn't this function be called makeRefPtr since it actually returns a RefPtr, just like makeUnique returns an std::unique_ptr ;)

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200102/67346292/attachment-0001.htm>

More information about the webkit-unassigned mailing list