Bug 69466 - Added a simpler mechanism for registering one-off finalizers
Summary: Added a simpler mechanism for registering one-off finalizers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Geoffrey Garen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-05 14:39 PDT by Geoffrey Garen
Modified: 2011-10-05 19:52 PDT (History)
3 users (show)

See Also:


Attachments
Patch (13.47 KB, patch)
2011-10-05 14:42 PDT, Geoffrey Garen
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2011-10-05 14:39:33 PDT
Added a simpler mechanism for registering one-off finalizers
Comment 1 Geoffrey Garen 2011-10-05 14:42:07 PDT
Created attachment 109864 [details]
Patch
Comment 2 Geoffrey Garen 2011-10-05 15:43:33 PDT
Committed r96760: <http://trac.webkit.org/changeset/96760>
Comment 3 Adam Roben (:aroben) 2011-10-05 15:49:41 PDT
Comment on attachment 109864 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=109864&action=review

> Source/JavaScriptCore/heap/Heap.cpp:706
> +    Weak<JSCell> weak(*globalData(), cell, &m_finalizerOwner, reinterpret_cast<void*>(finalizer));

I'm surprised a cast is needed here.
Comment 4 Geoffrey Garen 2011-10-05 18:57:34 PDT
> I'm surprised a cast is needed here.

C/C++ are based on an abstract machine in which pointers to data (which includes void*) and pointers to functions might be in different address spaces or of different sizes, or where one might be a direct pointer and the other a handle. So, in theory, casting between the two is illegal. That's why reinterpret_cast is required here.
Comment 6 Ryosuke Niwa 2011-10-05 19:52:01 PDT
Fixed Windows build in http://trac.webkit.org/changeset/96783.