From f7565abcfcf052d0d69ab5f54b700b1708aa55fb Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 19 Dec 2005 21:08:59 +0000 Subject: [PATCH] Add another overload for shared pointers. git-svn-id: https://svn.dealii.org/trunk@11881 0785d39b-7218-0410-832d-ea1e28bc413d --- .../base/include/base/memory_consumption.h | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/deal.II/base/include/base/memory_consumption.h b/deal.II/base/include/base/memory_consumption.h index d9f8da7af9..601b426bc6 100644 --- a/deal.II/base/include/base/memory_consumption.h +++ b/deal.II/base/include/base/memory_consumption.h @@ -15,6 +15,7 @@ #include +#include #include #include #include @@ -331,7 +332,7 @@ namespace MemoryConsumption template inline unsigned int memory_consumption (const T * const); - + /** * Return the amount of memory * used by a pointer. Make sure @@ -366,6 +367,17 @@ namespace MemoryConsumption inline unsigned int memory_consumption (void * const); + /** + * Return the amount of memory used + * by a boost shared pointer. Make + * sure that you are really + * interested in this, and not the + * amount of memory required by the + * object pointed to. + */ + template + inline + unsigned int memory_consumption (const boost::shared_ptr &); /** * For all other types which are @@ -584,7 +596,17 @@ namespace MemoryConsumption { return sizeof(void*); } - + + + + template + inline + unsigned int + memory_consumption (const boost::shared_ptr &ptr) + { + return sizeof(ptr); + } + template -- 2.39.5