RESOLVED FIXED 41422
Add assertion, off by default, for when you forget to do adoptRef
https://bugs.webkit.org/show_bug.cgi?id=41422
Summary Add assertion, off by default, for when you forget to do adoptRef
Darin Adler
Reported 2010-06-30 10:56:02 PDT
Add assertion, off by default, for when you forget to do adoptRef
Attachments
Patch (18.36 KB, patch)
2010-06-30 11:01 PDT, Darin Adler
no flags
Patch (18.43 KB, patch)
2010-06-30 14:12 PDT, Darin Adler
abarth: review+
Darin Adler
Comment 1 2010-06-30 11:01:25 PDT
Eric Seidel (no email)
Comment 2 2010-06-30 11:13:33 PDT
WebKit Review Bot
Comment 3 2010-06-30 12:27:44 PDT
WebKit Review Bot
Comment 4 2010-06-30 13:15:57 PDT
Darin Adler
Comment 5 2010-06-30 14:12:42 PDT
Darin Adler
Comment 6 2010-06-30 14:13:00 PDT
New patch fixes the release build.
Adam Barth
Comment 7 2010-06-30 14:14:23 PDT
Should we do style cleanup in a separate patch?
Darin Adler
Comment 8 2010-06-30 14:15:28 PDT
(In reply to comment #7) > Should we do style cleanup in a separate patch? The style changes here are small and should be easy to look at, and this is a patch that limits itself to a small number of source files, but if I have an enthusiastic reviewer who wants a style-only patch for the same files, that’s OK with me too.
Adam Barth
Comment 9 2010-06-30 14:22:57 PDT
Comment on attachment 60151 [details] Patch Looks good. Not sure why I went off to template land before for this patch. JavaScriptCore/wtf/PassRefPtr.h:32 + inline void adopted(const void*) One line? JavaScriptCore/wtf/RefCounted.h:70 + ASSERT(m_deletionHasBegun); This means we'll need to delete via deref(), right?
Eric Seidel (no email)
Comment 10 2010-06-30 14:32:08 PDT
Comment on attachment 60151 [details] Patch I'm curious if there is a benefit to making adopted() a free function instead of a member function?
Darin Adler
Comment 11 2010-06-30 15:07:36 PDT
(In reply to comment #9) > JavaScriptCore/wtf/PassRefPtr.h:32 > + inline void adopted(const void*) > One line? Sure, that would be OK. > JavaScriptCore/wtf/RefCounted.h:70 > + ASSERT(m_deletionHasBegun); > This means we'll need to delete via deref(), right? Yes. I think this goes hand in hand with requiring adoptRef. It found some good things when I turned it on. I had these assertions on for a while and was fixing all the things they found, but then I decided it was better to do a simple patch that makes it so other could work on it in parallel if they like.
Darin Adler
Comment 12 2010-06-30 15:07:54 PDT
(In reply to comment #10) > I'm curious if there is a benefit to making adopted() a free function instead of a member function? I don't think it could be a member function. A member function of what class?
Eric Seidel (no email)
Comment 13 2010-06-30 15:11:02 PDT
(In reply to comment #12) > (In reply to comment #10) > > I'm curious if there is a benefit to making adopted() a free function instead of a member function? > > I don't think it could be a member function. A member function of what class? I see. RefCounted is not the only way to make something play nice in the RefPtr system. Makes sense now.
Darin Adler
Comment 14 2010-06-30 16:09:25 PDT
Note You need to log in before you can comment on or make changes to this bug.