From: Wolfgang Bangerth Date: Sun, 1 Mar 2015 16:18:16 +0000 (-0600) Subject: Since all arguments to Vector::allocate() are the same, remove it. X-Git-Tag: v8.3.0-rc1~401^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0febd3d3e81f88f840aefff0d5969a3c460f621;p=dealii.git Since all arguments to Vector::allocate() are the same, remove it. --- diff --git a/include/deal.II/lac/vector.h b/include/deal.II/lac/vector.h index 4873249fec..1a08867d98 100644 --- a/include/deal.II/lac/vector.h +++ b/include/deal.II/lac/vector.h @@ -965,9 +965,10 @@ protected: private: /** - * Allocate and align @p v along 64-byte boundaries. + * Allocate and align @p val along 64-byte boundaries. The size + * of the allocated memory is determined by @p max_vec_size . */ - void allocate(const size_type n); + void allocate(); /** * Deallocate @p val. @@ -1051,7 +1052,7 @@ void Vector::reinit (const size_type n, const bool fast) { if (val) deallocate(); max_vec_size = n; - allocate(max_vec_size); + allocate(); }; vec_size = n; if (fast == false) diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h index 02c4e722f9..40e416589a 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -574,7 +574,7 @@ Vector::Vector (const Vector &v) { if (vec_size != 0) { - allocate(max_vec_size); + allocate(); *this = v; } } @@ -593,7 +593,7 @@ Vector::Vector (const Vector &v) { if (vec_size != 0) { - allocate(max_vec_size); + allocate(); std::copy (v.begin(), v.end(), begin()); } } @@ -613,7 +613,7 @@ Vector::Vector (const PETScWrappers::Vector &v) { if (vec_size != 0) { - allocate(max_vec_size); + allocate(); // get a representation of the vector // and copy it @@ -664,7 +664,7 @@ Vector::Vector (const TrilinosWrappers::MPI::Vector &v) { if (vec_size != 0) { - allocate(max_vec_size); + allocate(); // Copy the distributed vector to // a local one at all @@ -697,7 +697,7 @@ Vector::Vector (const TrilinosWrappers::Vector &v) { if (vec_size != 0) { - allocate(max_vec_size); + allocate(); // get a representation of the vector // and copy it @@ -2043,9 +2043,9 @@ Vector::memory_consumption () const template void -Vector::allocate(const size_type size) +Vector::allocate() { - val = static_cast(_mm_malloc (sizeof(Number)*size, 64)); + val = static_cast(_mm_malloc (sizeof(Number)*max_vec_size, 64)); Assert (val != 0, ExcOutOfMemory()); }