From 4c482b3b1dc47f3f80c5f64336a83caafb53c81d Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 6 Jan 2010 10:53:28 +0000 Subject: [PATCH] Make one function virtual. git-svn-id: https://svn.dealii.org/trunk@20311 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/vector_memory.h | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/deal.II/lac/include/lac/vector_memory.h b/deal.II/lac/include/lac/vector_memory.h index e78d41c7f5..b30a447ab8 100644 --- a/deal.II/lac/include/lac/vector_memory.h +++ b/deal.II/lac/include/lac/vector_memory.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -90,7 +90,7 @@ class VectorMemory : public Subscriptor * vectors: they are unspecified. */ virtual VECTOR* alloc () = 0; - + /** * Return a vector and indicate * that it is not going to be @@ -102,7 +102,7 @@ class VectorMemory : public Subscriptor /** @addtogroup Exceptions * @{ */ - + /** * No more available vectors. */ @@ -142,12 +142,12 @@ class VectorMemory : public Subscriptor * Conversion to regular pointer. */ operator VECTOR* () const; - + /** * Dereferencing operator. */ VECTOR& operator * () const; - + /** * Dereferencing operator. */ @@ -161,7 +161,7 @@ class VectorMemory : public Subscriptor * The pointer to the vector. */ VECTOR* v; - }; + }; }; @@ -203,7 +203,7 @@ class PrimitiveVectorMemory : public VectorMemory { return new VECTOR(); } - + /** * Return a vector and indicate * that it is not going to be @@ -260,7 +260,7 @@ class PrimitiveVectorMemory : public VectorMemory * template GrowingVectorMemory::Pool * GrowingVectorMemory::pool; * @endcode - * + * * @author Guido Kanschat, 1999, 2007 */ template > @@ -288,7 +288,7 @@ class GrowingVectorMemory : public VectorMemory * are allocated vectors left. */ ~GrowingVectorMemory(); - + /** * Return a pointer to a new * vector. The number of elements @@ -301,7 +301,7 @@ class GrowingVectorMemory : public VectorMemory * vectors: they are unspecified. */ virtual VECTOR* alloc (); - + /** * Return a vector and indicate * that it is not going to be @@ -321,13 +321,13 @@ class GrowingVectorMemory : public VectorMemory * not currently in use. */ static void release_unused_memory (); - + /** * Memory consumed by this class * and all currently allocated * vectors. */ - unsigned int memory_consumption() const; + virtual unsigned int memory_consumption() const; private: /** @@ -363,12 +363,12 @@ class GrowingVectorMemory : public VectorMemory /// Pointer to the storage object std::vector* data; }; - + /** * Array of allocated vectors. */ static Pool pool; - + /** * Overall number of * allocations. Only used for @@ -383,14 +383,14 @@ class GrowingVectorMemory : public VectorMemory * for detecting memory leaks. */ unsigned int current_alloc; - + /** * A flag controlling the logging * of statistics by the * destructor. */ bool log_statistics; - + /** * Mutex to synchronise access to * internal data of this object @@ -488,7 +488,7 @@ GrowingVectorMemory::Pool::initialize(const unsigned int size) if (data == 0) { data = new std::vector(size); - + for (typename std::vector::iterator i= data->begin(); i != data->end(); ++i) @@ -504,7 +504,7 @@ template inline GrowingVectorMemory::GrowingVectorMemory (const unsigned int initial_size, const bool log_statistics) - + : total_alloc(0), current_alloc(0), @@ -556,7 +556,7 @@ GrowingVectorMemory::alloc () // just allocate a new one const entry_type t (true, new VECTOR); pool.data->push_back(t); - + return t.second; } @@ -602,7 +602,7 @@ GrowingVectorMemory::release_unused_memory () delete i->second; else new_data.push_back (*i); - + *pool.data = new_data; } } -- 2.39.5