WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
159837
Add move constructor / assignment operator to ListHashSet
https://bugs.webkit.org/show_bug.cgi?id=159837
Summary
Add move constructor / assignment operator to ListHashSet
Chris Dumez
Reported
2016-07-15 14:42:58 PDT
Add move constructor / assignment operator to ListHashSet.
Attachments
Patch
(1.15 KB, patch)
2016-07-15 14:43 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(3.90 KB, patch)
2016-07-15 14:57 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews115 for mac-yosemite
(1.29 MB, application/zip)
2016-07-15 16:06 PDT
,
Build Bot
no flags
Details
Patch
(7.82 KB, patch)
2016-07-15 17:14 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2016-07-15 14:43:40 PDT
Created
attachment 283793
[details]
Patch
Alex Christensen
Comment 2
2016-07-15 14:48:57 PDT
Comment on
attachment 283793
[details]
Patch As long as we're touching this file, let's pragma once it and make 0's nullptrs.
Chris Dumez
Comment 3
2016-07-15 14:57:01 PDT
Created
attachment 283795
[details]
Patch
WebKit Commit Bot
Comment 4
2016-07-15 15:26:33 PDT
Comment on
attachment 283795
[details]
Patch Clearing flags on attachment: 283795 Committed
r203304
: <
http://trac.webkit.org/changeset/203304
>
WebKit Commit Bot
Comment 5
2016-07-15 15:26:38 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 6
2016-07-15 15:35:58 PDT
Comment on
attachment 283795
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=283795&action=review
> Source/WTF/ChangeLog:3 > + Add move constructor / assignment operator to ListHashSet
Why not add a unit test?
> Source/WTF/wtf/ListHashSet.h:73 > + ListHashSet(ListHashSet&&) = default;
How can this be right? Doesn’t it leave the
Chris Dumez
Comment 7
2016-07-15 15:36:53 PDT
(In reply to
comment #6
)
> Comment on
attachment 283795
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=283795&action=review
> > > Source/WTF/ChangeLog:3 > > + Add move constructor / assignment operator to ListHashSet > > Why not add a unit test? > > > Source/WTF/wtf/ListHashSet.h:73 > > + ListHashSet(ListHashSet&&) = default; > > How can this be right? Doesn’t it leave the
You did not finish your sentence.
Chris Dumez
Comment 8
2016-07-15 15:39:23 PDT
Reverted
r203304
for reason: This is wrong because of Node* entries in the internal HashMap Committed
r203306
: <
http://trac.webkit.org/changeset/203306
>
Darin Adler
Comment 9
2016-07-15 15:39:37 PDT
Comment on
attachment 283795
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=283795&action=review
>> Source/WTF/wtf/ListHashSet.h:73 >> + ListHashSet(ListHashSet&&) = default; > > How can this be right? Doesn’t it leave the
Oops, I didn’t realize I included this. I had meant to delete it. What I meant was: This leaves the list hash set on the right side in a state where you can’t use it. It’s common for us to instead reset the moved object to an empty state in our classes; for example, I think HashSet does this. This would require explicit code to set m_head and m_tail to nullptr. The downside is that this would be additional code that the compiler might not be smart enough to remove as a dead-store optimization. The upside is that this can be used in code that wants to move from an object and then count on it being valid empty object.
Chris Dumez
Comment 10
2016-07-15 15:41:43 PDT
(In reply to
comment #9
)
> Comment on
attachment 283795
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=283795&action=review
> > >> Source/WTF/wtf/ListHashSet.h:73 > >> + ListHashSet(ListHashSet&&) = default; > > > > How can this be right? Doesn’t it leave the > > Oops, I didn’t realize I included this. I had meant to delete it. > > What I meant was: This leaves the list hash set on the right side in a state > where you can’t use it. It’s common for us to instead reset the moved object > to an empty state in our classes; for example, I think HashSet does this. > This would require explicit code to set m_head and m_tail to nullptr. The > downside is that this would be additional code that the compiler might not > be smart enough to remove as a dead-store optimization. The upside is that > this can be used in code that wants to move from an object and then count on > it being valid empty object.
Ok, I'll look into adding a test and a better move constructor / assignment op.
Build Bot
Comment 11
2016-07-15 16:06:09 PDT
Comment on
attachment 283795
[details]
Patch
Attachment 283795
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/1687903
New failing tests: accessibility/mac/input-replacevalue-userinfo.html
Build Bot
Comment 12
2016-07-15 16:06:14 PDT
Created
attachment 283807
[details]
Archive of layout-test-results from ews115 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-yosemite Platform: Mac OS X 10.10.5
Chris Dumez
Comment 13
2016-07-15 17:14:13 PDT
Created
attachment 283824
[details]
Patch
WebKit Commit Bot
Comment 14
2016-07-16 09:34:02 PDT
Comment on
attachment 283824
[details]
Patch Clearing flags on attachment: 283824 Committed
r203325
: <
http://trac.webkit.org/changeset/203325
>
WebKit Commit Bot
Comment 15
2016-07-16 09:34:08 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug