summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-28 10:55:56 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-28 10:55:56 +0000
commit900793c3132e5146220482f5532e81d037baa1e6 (patch)
treeec2fc988560f41f87096e2641c809ff51b5e2ad1 /libstdc++-v3
parent09a2ff972177247d648a0a63e70d9067ab4542fb (diff)
downloadppe42-gcc-900793c3132e5146220482f5532e81d037baa1e6.tar.gz
ppe42-gcc-900793c3132e5146220482f5532e81d037baa1e6.zip
2011-04-28 Paolo Carlini <paolo.carlini@oracle.com>
Revert unintended changes to include/parallel files. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173066 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/include/parallel/losertree.h26
-rw-r--r--libstdc++-v3/include/parallel/multiway_merge.h19
-rw-r--r--libstdc++-v3/include/parallel/multiway_mergesort.h11
-rw-r--r--libstdc++-v3/include/parallel/par_loop.h19
-rw-r--r--libstdc++-v3/include/parallel/partial_sum.h3
-rw-r--r--libstdc++-v3/include/parallel/quicksort.h4
-rw-r--r--libstdc++-v3/include/parallel/random_shuffle.h13
7 files changed, 29 insertions, 66 deletions
diff --git a/libstdc++-v3/include/parallel/losertree.h b/libstdc++-v3/include/parallel/losertree.h
index 306fcd8856f..8d7b137aaf5 100644
--- a/libstdc++-v3/include/parallel/losertree.h
+++ b/libstdc++-v3/include/parallel/losertree.h
@@ -1,6 +1,6 @@
// -*- C++ -*-
-// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009 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
@@ -116,11 +116,7 @@ namespace __gnu_parallel
* @brief The destructor.
*/
~_LoserTreeBase()
- {
- for (unsigned int __i = 0; __i < (2 * _M_k); ++__i)
- _M_losers[__i].~_Loser();
- ::operator delete(_M_losers);
- }
+ { ::operator delete(_M_losers); }
/**
* @brief Initializes the sequence "_M_source" with the element "__key".
@@ -135,15 +131,15 @@ namespace __gnu_parallel
{
unsigned int __pos = _M_k + __source;
- if (_M_first_insert)
+ if(_M_first_insert)
{
- // Construct all keys, so we can easily destruct them.
+ // Construct all keys, so we can easily deconstruct them.
for (unsigned int __i = 0; __i < (2 * _M_k); ++__i)
new(&(_M_losers[__i]._M_key)) _Tp(__key);
_M_first_insert = false;
}
else
- _M_losers[__pos]._M_key = __key;
+ new(&(_M_losers[__pos]._M_key)) _Tp(__key);
_M_losers[__pos]._M_sup = __sup;
_M_losers[__pos]._M_source = __source;
@@ -383,7 +379,7 @@ namespace __gnu_parallel
}
~_LoserTreePointerBase()
- { delete[] _M_losers; }
+ { ::operator delete[](_M_losers); }
int __get_min_source()
{ return _M_losers[0]._M_source; }
@@ -596,17 +592,13 @@ namespace __gnu_parallel
for (unsigned int __i = _M_k + _M_ik - 1; __i < (2 * _M_k); ++__i)
{
- ::new(&(_M_losers[__i]._M_key)) _Tp(__sentinel);
+ _M_losers[__i]._M_key = __sentinel;
_M_losers[__i]._M_source = -1;
}
}
~_LoserTreeUnguardedBase()
- {
- for (unsigned int __i = 0; __i < (2 * _M_k); ++__i)
- _M_losers[__i].~_Loser();
- ::operator delete(_M_losers);
- }
+ { ::operator delete(_M_losers); }
int
__get_min_source()
@@ -623,7 +615,7 @@ namespace __gnu_parallel
{
unsigned int __pos = _M_k + __source;
- ::new(&(_M_losers[__pos]._M_key)) _Tp(__key);
+ new(&(_M_losers[__pos]._M_key)) _Tp(__key);
_M_losers[__pos]._M_source = __source;
}
};
diff --git a/libstdc++-v3/include/parallel/multiway_merge.h b/libstdc++-v3/include/parallel/multiway_merge.h
index 1c73ad0042d..a5fd3be1bd0 100644
--- a/libstdc++-v3/include/parallel/multiway_merge.h
+++ b/libstdc++-v3/include/parallel/multiway_merge.h
@@ -1045,12 +1045,11 @@ namespace __gnu_parallel
_ValueType;
// __k sequences.
- const _SeqNumber __k
- = static_cast<_SeqNumber>(__seqs_end - __seqs_begin);
+ _SeqNumber __k = static_cast<_SeqNumber>(__seqs_end - __seqs_begin);
- const _ThreadIndex __num_threads = omp_get_num_threads();
+ _ThreadIndex __num_threads = omp_get_num_threads();
- const _DifferenceType __num_samples =
+ _DifferenceType __num_samples =
__gnu_parallel::_Settings::get().merge_oversampling * __num_threads;
_ValueType* __samples = static_cast<_ValueType*>
@@ -1097,10 +1096,6 @@ namespace __gnu_parallel
__pieces[__slab][__seq].second =
_GLIBCXX_PARALLEL_LENGTH(__seqs_begin[__seq]);
}
-
- for (_SeqNumber __s = 0; __s < __k; ++__s)
- for (_DifferenceType __i = 0; __i < __num_samples; ++__i)
- __samples[__s * __num_samples + __i].~_ValueType();
::operator delete(__samples);
}
@@ -1263,10 +1258,10 @@ namespace __gnu_parallel
__length = std::min<_DifferenceTp>(__length, __total_length);
if (__total_length == 0 || __k == 0)
- {
- delete[] __ne_seqs;
- return __target;
- }
+ {
+ delete[] __ne_seqs;
+ return __target;
+ }
std::vector<std::pair<_DifferenceType, _DifferenceType> >* __pieces;
diff --git a/libstdc++-v3/include/parallel/multiway_mergesort.h b/libstdc++-v3/include/parallel/multiway_mergesort.h
index 80267f923b5..2cb80138766 100644
--- a/libstdc++-v3/include/parallel/multiway_mergesort.h
+++ b/libstdc++-v3/include/parallel/multiway_mergesort.h
@@ -378,8 +378,6 @@ namespace __gnu_parallel
# pragma omp barrier
- for (_DifferenceType __i = 0; __i < __length_local; ++__i)
- __sd->_M_temporary[__iam][__i].~_ValueType();
::operator delete(__sd->_M_temporary[__iam]);
}
@@ -415,7 +413,6 @@ namespace __gnu_parallel
// shared variables
_PMWMSSortingData<_RAIter> __sd;
_DifferenceType* __starts;
- _DifferenceType __size;
# pragma omp parallel num_threads(__num_threads)
{
@@ -430,7 +427,7 @@ namespace __gnu_parallel
if (!__exact)
{
- __size =
+ _DifferenceType __size =
(_Settings::get().sort_mwms_oversampling * __num_threads - 1)
* __num_threads;
__sd._M_samples = static_cast<_ValueType*>
@@ -466,11 +463,7 @@ namespace __gnu_parallel
delete[] __sd._M_temporary;
if (!__exact)
- {
- for (_DifferenceType __i = 0; __i < __size; ++__i)
- __sd._M_samples[__i].~_ValueType();
- ::operator delete(__sd._M_samples);
- }
+ ::operator delete(__sd._M_samples);
delete[] __sd._M_offsets;
delete[] __sd._M_pieces;
diff --git a/libstdc++-v3/include/parallel/par_loop.h b/libstdc++-v3/include/parallel/par_loop.h
index d9116908567..9671c1dd398 100644
--- a/libstdc++-v3/include/parallel/par_loop.h
+++ b/libstdc++-v3/include/parallel/par_loop.h
@@ -91,7 +91,8 @@ namespace __gnu_parallel
_ThreadIndex __iam = omp_get_thread_num();
// Neutral element.
- _Result* __reduct;
+ _Result* __reduct = static_cast<_Result*>
+ (::operator new(sizeof(_Result)));
_DifferenceType
__start = __equally_split_point(__length, __num_threads, __iam),
@@ -99,7 +100,7 @@ namespace __gnu_parallel
if (__start < __stop)
{
- __reduct = new _Result(__f(__o, __begin + __start));
+ new(__reduct) _Result(__f(__o, __begin + __start));
++__start;
__constructed[__iam] = true;
}
@@ -109,26 +110,18 @@ namespace __gnu_parallel
for (; __start < __stop; ++__start)
*__reduct = __r(*__reduct, __f(__o, __begin + __start));
- if (__constructed[__iam])
- {
- ::new(&__thread_results[__iam]) _Result(*__reduct);
- delete __reduct;
- }
+ __thread_results[__iam] = *__reduct;
} //parallel
for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
if (__constructed[__i])
- {
- __output = __r(__output, __thread_results[__i]);
- __thread_results[__i].~_Result();
- }
+ __output = __r(__output, __thread_results[__i]);
// Points to last element processed (needed as return value for
// some algorithms like transform).
__f._M_finish_iterator = __begin + __length;
- ::operator delete(__thread_results);
-
+ delete[] __thread_results;
delete[] __constructed;
return __o;
diff --git a/libstdc++-v3/include/parallel/partial_sum.h b/libstdc++-v3/include/parallel/partial_sum.h
index 1a7697a6cef..425e868fe6b 100644
--- a/libstdc++-v3/include/parallel/partial_sum.h
+++ b/libstdc++-v3/include/parallel/partial_sum.h
@@ -184,10 +184,7 @@ namespace __gnu_parallel
__bin_op, __sums[__iam]);
} //parallel
- for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
- __sums[__i].~_ValueType();
::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 1b4d5983d06..1884eb867fa 100644
--- a/libstdc++-v3/include/parallel/quicksort.h
+++ b/libstdc++-v3/include/parallel/quicksort.h
@@ -1,6 +1,6 @@
// -*- C++ -*-
-// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 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
@@ -82,8 +82,6 @@ namespace __gnu_parallel
_DifferenceType __split = __parallel_partition(__begin, __end,
__pred, __num_threads);
- for (_DifferenceType __s = 0; __s < __num_samples; ++__s)
- __samples[__s].~_ValueType();
::operator delete(__samples);
return __split;
diff --git a/libstdc++-v3/include/parallel/random_shuffle.h b/libstdc++-v3/include/parallel/random_shuffle.h
index c3967c22880..bae95724966 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, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 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
@@ -209,7 +209,7 @@ namespace __gnu_parallel
_ThreadIndex __target_p = __bin_proc[__target_bin];
// Last column [__d->_M_num_threads] stays unchanged.
- ::new(&(__temporaries[__target_p][__dist[__target_bin + 1]++]))
+ ::new(&(__temporaries[__target_p][__dist[__target_bin + 1]++]))
_ValueType(*(__source + __i + __start));
}
@@ -227,8 +227,8 @@ namespace __gnu_parallel
(__sd->_M_temporaries[__iam]
+ (__b == __d->_M_bins_begin
? 0 : __sd->_M_dist[__b][__d->_M_num_threads])),
- *__end = (__sd->_M_temporaries[__iam]
- + __sd->_M_dist[__b + 1][__d->_M_num_threads]);
+ * __end = (__sd->_M_temporaries[__iam]
+ + __sd->_M_dist[__b + 1][__d->_M_num_threads]);
__sequential_random_shuffle(__begin, __end, __rng);
std::copy(__begin, __end, __sd->_M_source + __global_offset
@@ -236,8 +236,6 @@ namespace __gnu_parallel
? 0 : __sd->_M_dist[__b][__d->_M_num_threads]));
}
- for (_SequenceIndex __i = 0; __i < __offset; ++__i)
- __sd->_M_temporaries[__iam][__i].~_ValueType();
::operator delete(__sd->_M_temporaries[__iam]);
}
@@ -503,9 +501,6 @@ namespace __gnu_parallel
delete[] __dist0;
delete[] __dist1;
delete[] __oracles;
-
- for (_DifferenceType __i = 0; __i < __n; ++__i)
- __target[__i].~_ValueType();
::operator delete(__target);
}
else
OpenPOWER on IntegriCloud