Skip to content

Commit

Permalink
Merge pull request #13014 from bangerth/aligned-2
Browse files Browse the repository at this point in the history
Avoid unnecessary memory allocation.
  • Loading branch information
drwells committed Dec 1, 2021
2 parents d745029 + 45728dc commit 1d2117d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
7 changes: 3 additions & 4 deletions include/deal.II/base/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -2154,10 +2154,9 @@ TableBase<N, T>::TableBase(const TableIndices<N> &sizes,
template <int N, typename T>
TableBase<N, T>::TableBase(const TableBase<N, T> &src)
: Subscriptor()
{
reinit(src.table_size, true);
values = src.values;
}
, values(src.values)
, table_size(src.table_size)
{}



Expand Down
10 changes: 4 additions & 6 deletions tests/base/aligned_vector_memory_02.output
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
DEAL::---- Creating outer table
DEAL::default constructor. Object number 0
DEAL::---- Cloning outer table
DEAL::default constructor. Object number 1
DEAL::destructor. Object number 1
DEAL::copy constructor from 0. Object number 2
DEAL::copy constructor from 0. Object number 1
DEAL::---- Destroying the clone
DEAL::destructor. Object number 2
DEAL::destructor. Object number 1
DEAL::---- Destroying the source table
DEAL::destructor. Object number 0
DEAL::Objects created: 3
DEAL::Objects destroyed: 3
DEAL::Objects created: 2
DEAL::Objects destroyed: 2

0 comments on commit 1d2117d

Please sign in to comment.