[webkit-reviews] review denied: [Bug 115033] Add move semantics to RefPtr : [Attachment 199244] patch v3

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 23 11:20:49 PDT 2013


Benjamin Poulain <benjamin at webkit.org> has denied Mikhail Pozdnyakov
<mikhail.pozdnyakov at intel.com>'s request for review:
Bug 115033: Add move semantics to RefPtr
https://bugs.webkit.org/show_bug.cgi?id=115033

Attachment 199244: patch v3
https://bugs.webkit.org/attachment.cgi?id=199244&action=review

------- Additional Comments from Benjamin Poulain <benjamin at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=199244&action=review


> Source/WTF/wtf/RefPtr.h:160
> +	   if (m_ptr != o.get()) {
> +	       derefIfNotNull(m_ptr);
> +	       m_ptr = o.release().leakRef();
> +	   }
> +	   return *this;

I don't understand why you do this.

If you have
    RefPtr a = [foobar];
    RefPtr b = a;
    a = std::move(b);

"b" is unchanged, and the refcount is +2. This is counter-intuitive for move
semantic.

> Source/WTF/wtf/RefPtr.h:169
> +	   if (m_ptr != o.get()) {
> +	       derefIfNotNull(m_ptr);
> +	       m_ptr = o.release().leakRef();
> +	   }
> +	   return *this;

ditto


More information about the webkit-reviews mailing list