From fac9044d26a47eae4ac85ca1e46d8c9665b1548c Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 1 Jan 2008 19:05:41 +0000 Subject: re PR libstdc++/34095 (parallel mode: segfault in std::sort) 2008-01-01 Paolo Carlini PR libstdc++/34095 * include/parallel/multiway_merge.h (multiway_merge_bubble, parallel_multiway_merge): Together with ::operator new use ::operator delete. * include/parallel/losertree.h (LoserTree<>::~LoserTree): Likewise. * include/parallel/quicksort.h (parallel_sort_qs_divide): Likewise. * include/parallel/random_shuffle.h (parallel_random_shuffle_drs_pu, sequential_random_shuffle): Likewise. * include/parallel/tree.h (_M_not_sorted_bulk_insertion_construction): Likewise. * include/parallel/multiway_mergesort.h (parallel_sort_mwms_pu, parallel_sort_mwms): Likewise. * include/parallel/partial_sum.h (parallel_partial_sum_linear): Likewise. * testsuite/25_algorithms/sort/34095.cc: New. From-SVN: r131247 --- libstdc++-v3/include/parallel/losertree.h | 4 ++-- libstdc++-v3/include/parallel/multiway_merge.h | 6 +++--- libstdc++-v3/include/parallel/multiway_mergesort.h | 6 +++--- libstdc++-v3/include/parallel/partial_sum.h | 4 ++-- libstdc++-v3/include/parallel/quicksort.h | 4 ++-- libstdc++-v3/include/parallel/random_shuffle.h | 6 +++--- libstdc++-v3/include/parallel/tree.h | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) (limited to 'libstdc++-v3/include') diff --git a/libstdc++-v3/include/parallel/losertree.h b/libstdc++-v3/include/parallel/losertree.h index 2f2fae7..786b8fb 100644 --- a/libstdc++-v3/include/parallel/losertree.h +++ b/libstdc++-v3/include/parallel/losertree.h @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -250,7 +250,7 @@ template > } inline ~LoserTree() - { delete[] losers; } + { ::operator delete(losers); } inline int get_min_source() diff --git a/libstdc++-v3/include/parallel/multiway_merge.h b/libstdc++-v3/include/parallel/multiway_merge.h index 818049c..98f19c2 100644 --- a/libstdc++-v3/include/parallel/multiway_merge.h +++ b/libstdc++-v3/include/parallel/multiway_merge.h @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -936,7 +936,7 @@ template< } } - delete fe; //Destructors already called. + ::operator delete(fe); //Destructors already called. delete[] source; return target; @@ -1622,7 +1622,7 @@ template< else pieces[slab][seq].second = _GLIBCXX_PARALLEL_LENGTH(seqs_begin[seq]); } - delete[] samples; + ::operator delete(samples); } else { diff --git a/libstdc++-v3/include/parallel/multiway_mergesort.h b/libstdc++-v3/include/parallel/multiway_mergesort.h index e541850..502cfab 100644 --- a/libstdc++-v3/include/parallel/multiway_mergesort.h +++ b/libstdc++-v3/include/parallel/multiway_mergesort.h @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -321,7 +321,7 @@ template sd->source + offset); #endif - delete[] sd->temporaries[iam]; + ::operator delete(sd->temporaries[iam]); } /** @brief PMWMS main call. @@ -415,7 +415,7 @@ template delete[] sd.merging_places; if (Settings::sort_splitting == Settings::SAMPLING) - delete[] sd.samples; + ::operator delete(sd.samples); delete[] sd.offsets; delete[] sd.pieces; diff --git a/libstdc++-v3/include/parallel/partial_sum.h b/libstdc++-v3/include/parallel/partial_sum.h index e4a4276..c165729 100644 --- a/libstdc++-v3/include/parallel/partial_sum.h +++ b/libstdc++-v3/include/parallel/partial_sum.h @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -182,7 +182,7 @@ template< sums[iam]); } //parallel - delete[] sums; + ::operator delete(sums); delete[] borders; return result + n; diff --git a/libstdc++-v3/include/parallel/quicksort.h b/libstdc++-v3/include/parallel/quicksort.h index d94a49d..9228647 100644 --- a/libstdc++-v3/include/parallel/quicksort.h +++ b/libstdc++-v3/include/parallel/quicksort.h @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -91,7 +91,7 @@ namespace __gnu_parallel pred(comp, pivot); difference_type split = parallel_partition(begin, end, pred, num_threads); - delete[] samples; + ::operator delete(samples); return split; } diff --git a/libstdc++-v3/include/parallel/random_shuffle.h b/libstdc++-v3/include/parallel/random_shuffle.h index 663962b..dd086ba 100644 --- a/libstdc++-v3/include/parallel/random_shuffle.h +++ b/libstdc++-v3/include/parallel/random_shuffle.h @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -237,7 +237,7 @@ template ((b == d->bins_begin) ? 0 : sd->dist[b][d->num_threads])); } - delete[] sd->temporaries[iam]; + ::operator delete(sd->temporaries[iam]); } /** @brief Round up to the next greater power of 2. @@ -490,7 +490,7 @@ template delete[] dist0; delete[] dist1; delete[] oracles; - delete[] target; + ::operator delete(target); } else __gnu_sequential::random_shuffle(begin, end, rng); diff --git a/libstdc++-v3/include/parallel/tree.h b/libstdc++-v3/include/parallel/tree.h index eae33c0..eed0b92 100644 --- a/libstdc++-v3/include/parallel/tree.h +++ b/libstdc++-v3/include/parallel/tree.h @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -1344,7 +1344,7 @@ namespace __gnu_parallel _M_sorted_bulk_construction(sorted_access, beg_partition, n, num_threads, strictly_less_or_less_equal); else _M_sorted_bulk_insertion(sorted_access, beg_partition, n, num_threads, strictly_less_or_less_equal); - delete v; + ::operator delete(v); } /** @brief Construct a tree sequentially using the parallel routine -- cgit v1.1