[webkit-dev] Terminology for giving up ownership: take, release, move

Darin Adler darin at apple.com
Tue Sep 6 20:20:31 PDT 2016

> On Sep 6, 2016, at 6:43 PM, Maciej Stachowiak <mjs at apple.com> wrote:
> RefPtr does also have regular release() though. I'm not sure if this is for a practical reason or just no one has fixed it yet.

It’s still around until we finish getting rid of PassRefPtr, that’s all.

> A wacky solution, based on your suggestion for releaseImpl, would be to have a nonNull method which asserts the pointer is not null and then returns a self reference, so you'd do move(ref.nonNull()).

I don’t think we can do that. I don’t know how to change a RefPtr<X> into a Ref<X>& in C++ even though we know the underlying object layout is identical.

— Darin

More information about the webkit-dev mailing list