vtk-m/vtkm/exec/internal
Kenneth Moreland e3dfa48910 Do not attempt to move non-trivial objects in Variant
The `Variant` class has separate implementations for its move and copy
constructors/assignment operators depending on whether the classes it
holds can be trivially moved. If the objects are trivial, Variant is
trivial as well. However, in the case where the objects are not trivial,
special construction and copying needs to be done.

Previously, the non-trivial `Variant` defined a move constructor that
did a byte copy of the contained object and reset the right hand side
object so that it did not attempt to destroy the object. That usually
works because it guarantees that only one version of the `Variant` will
attempt to destroy the object and its resources should be cleaned up
correctly.

But C++ is a funny language that lets you do weird things. Turns out
there are cases where moving the location of memory for an object
without calling the proper copy method can invalidate the object. For
example, if the object holds a pointer to one of its own members, that
pointer will become invalid. Also, if it points to something that points
back, then the object will need to update those pointers when it is
moved. GCC's version of `std::string` seems to be a type like this.

Solve the problem by simply deleting the move constructors. The copy
constructors and destructor will be called instead to properly manage
the object. A test for these conditions is added to `UnitTestVariant`.
2020-11-09 12:48:10 -07:00
..
testing Do not attempt to move non-trivial objects in Variant 2020-11-09 12:48:10 -07:00
.gitattributes clang-format: apply to the entire tree 2017-05-25 07:51:37 -04:00
CMakeLists.txt Make separate exec and cont versions of Variant 2020-11-09 12:48:10 -07:00
ErrorMessageBuffer.h Correct symbol visibility issues found by ubsan testing 2019-09-11 08:30:49 -04:00
FastVec.h conslidate the license statement 2019-04-17 10:57:13 -06:00
ReduceByKeyLookup.h Add non-templated base class to Keys class. 2020-05-21 08:34:07 -06:00
TaskSingular.h Remove ArrayHandleStreaming capabilities 2020-03-24 15:01:56 -06:00
TwoLevelUniformGridExecutionObject.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
Variant.h Make separate exec and cont versions of Variant 2020-11-09 12:48:10 -07:00
WorkletInvokeFunctorDetail.h relaxes ThreadIndicesType across multiple worklets fetchs 2020-04-24 17:39:31 -04:00
WorkletInvokeFunctorDetail.h.in relaxes ThreadIndicesType across multiple worklets fetchs 2020-04-24 17:39:31 -04:00