From a0febd3d3e81f88f840aefff0d5969a3c460f621 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 1 Mar 2015 10:18:16 -0600 Subject: [PATCH] Since all arguments to Vector::allocate() are the same, remove it. --- include/deal.II/lac/vector.h | 7 ++++--- include/deal.II/lac/vector.templates.h | 14 +++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) 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()); } -- 2.39.5