]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Do not check that 'new' returned a non-NULL pointer.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 18 Jun 2017 01:08:56 +0000 (19:08 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 19 Jun 2017 03:48:48 +0000 (21:48 -0600)
'new' hasn't done that since C++98 but instead throws a std::bad_alloc itself. Consequently,
the assertion would never have failed.

include/deal.II/dofs/dof_handler.h
source/dofs/dof_handler.cc

index af38d3429345863a692ffab7964e0e17d18999b2..ffbc2143372bfb14686d40c0ea9a2e80380d6214 100644 (file)
@@ -1003,11 +1003,6 @@ private:
                     const unsigned int dof_number,
                     const types::global_dof_index index);
 
-    /**
-     * Exception.
-     */
-    DeclException0 (ExcNoMemory);
-
   private:
     /**
      * Coarsest level for which this object stores DoF indices.
index 82d88ff42fdac08b23bfe97a89fc45a78212d900..6ec3099f4fceede2ea7db081c0b414b7c11675c7 100644 (file)
@@ -1540,14 +1540,10 @@ void DoFHandler<dim, spacedim>::MGVertexDoFs::init (const unsigned int cl, const
   const unsigned int n_indices = n_levels * dofs_per_vertex;
 
   indices = new types::global_dof_index[n_indices];
-  Assert (indices != nullptr, ExcNoMemory ());
-
   for (unsigned int i = 0; i < n_indices; ++i)
     indices[i] = DoFHandler<dim, spacedim>::invalid_dof_index;
 
   indices_offset = new types::global_dof_index[n_levels];
-  Assert (indices != nullptr, ExcNoMemory ());
-
   for (unsigned int i = 0; i < n_levels; ++i)
     indices_offset[i] = i * dofs_per_vertex;
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.