Simplify union payload copying#11353
Closed
smessmer wants to merge 10 commits intoexport-D9778042from
Closed
Conversation
Differential Revision: D9694326 Differential Version: 57135216
ezyang
approved these changes
Sep 7, 2018
Contributor
ezyang
left a comment
There was a problem hiding this comment.
Worth mentioning that this is only OK as long as everything in the union is trivially copyable/constructible...
Differential Revision: D9694326 Differential Version: 57214006
Contributor
Author
|
@ezyang If a member is not trivially copyable/constructible, the compiler should delete the copy constructor of the union, i.e. it would be a compiler error. |
This was referenced Sep 7, 2018
Closed
Closed
Differential Revision: D9694326 Differential Version: 57417173
Differential Revision: D9694326 Differential Version: 57452245
This was referenced Sep 11, 2018
Closed
Differential Revision: D9694326 Differential Version: 5753540
This was referenced Sep 11, 2018
Closed
Differential Revision: D9694326 Differential Version: 57551490
Differential Revision: D9694326 Differential Version: 57670062
Differential Revision: D9694326 Differential Version: 57695965
Differential Revision: D9694326 Differential Version: 57757847
Differential Revision: D9694326 Differential Version: 57851519
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack:
:white_circle: #11352 Remove intrusive_ptr::reclaim() in Storage 💛
:white_circle: #11547 Remove intrusive_ptr::reclaim() in Storage (2/2) 💚
:black_circle: #11353 Simplify union payload copying 💛
:white_circle: #11355 Simplify IValue::toTensor() 💛
:white_circle: #11402 Simplify Blob move constructor/assignment 💛
:white_circle: #11414 IValue can store Blob 💛
:white_circle: #11548 Blob doesn't allow access to destroyCall anymore 💛
:white_circle: #11500 Use TypeMeta::dtor() instead of Blob::DestroyCall 💛
:white_circle: #11501 Move GetExceptionString to Error.h 💛
:white_circle: #11502 Improve TypeMeta 💛
Before, there was one extra member in the union that had to be at least as large as the largest other member, because it was used for copying.
Now, this isn't needed anymore and we copy the union directly.
Differential Revision: D9694326