[Webkit-unassigned] [Bug 87938] [GTK] Avoid unnecessary heap allocations during drag and drop operations

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 31 06:07:35 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=87938


Martin Robinson <mrobinson at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #145013|review?                     |review+
               Flag|                            |




--- Comment #3 from Martin Robinson <mrobinson at webkit.org>  2012-05-31 06:07:35 PST ---
(From update of attachment 145013)
View in context: https://bugs.webkit.org/attachment.cgi?id=145013&action=review

Hrm. I'm not sure if I prefer the new approach. It does avoid an allocation on the heap, but replaces it with an allocation on the stack which is arguably riskier and with the result of creating more code.   Additionally this moves from two places in the code having to create DragData  to six.

I worry also that the use of position as an in and out parameter could be confusing and would prefer to simply have a getter on DragAndDropHelper.

> Source/WebCore/platform/gtk/GtkDragAndDropHelper.cpp:161
> -        return adoptPtr(static_cast<DragData*>(0));
> +        return 0;
>  

I'm not sure what I was thinking when I wrote this code. This should be return nullptr here.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list