[pstl] A fix for move placement-new (and destroy) allocated objects from raw memory.
authorDvorskiy, Mikhail <mikhail.dvorskiy@intel.com>
Tue, 10 Mar 2020 16:09:57 +0000 (19:09 +0300)
committerDvorskiy, Mikhail <mikhail.dvorskiy@intel.com>
Mon, 18 May 2020 14:00:13 +0000 (17:00 +0300)
commit5b0502dff5b6f510fbf823059faa042dd1523cef
treea1342e83f850955f8debc01bed156ed1e76d26b3
parent03092f2fa7b4d2609858666f8bba293078582fdd
[pstl] A fix for move placement-new (and destroy) allocated objects from raw memory.

https://reviews.llvm.org/D74123

The fix affects follow algorithms:
remove_if, unique, rotate, inplace_merge, partial_sort_copy, set_union, set_intersection, set_difference, set_symmetric_difference.

For "is_trivial" types there are no problems with "creating objects/clean-up"
For non-trivial types the algo results are also correct, but possible incorrect copying/moving "operator=" calls "by raw memory" within one of mentioned algo or incorrect destructor calls in the end of algo.
pstl/include/pstl/internal/algorithm_impl.h
pstl/include/pstl/internal/memory_impl.h
pstl/include/pstl/internal/parallel_backend_utils.h
pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp
pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp
pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp
pstl/test/std/algorithms/alg.modifying.operations/unique.pass.cpp
pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp
pstl/test/std/algorithms/alg.sorting/partial_sort_copy.pass.cpp
pstl/test/support/utils.h