]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix memory consumption of std::vector<T> with more than 4G.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Jun 2011 16:34:39 +0000 (16:34 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Jun 2011 16:34:39 +0000 (16:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@23871 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/memory_consumption.h

index 7faef9028d95169ad12a434ff894a40d97d5a749..ea2757024f1ebbf410f4f393aea120d1d202b5ae 100644 (file)
@@ -514,7 +514,7 @@ namespace MemoryConsumption
   template <typename T>
   std::size_t memory_consumption (const std::vector<T> &v)
   {
-    unsigned int mem = sizeof(std::vector<T>);
+    std::size_t mem = sizeof(std::vector<T>);
     const unsigned int n = v.size();
     for (unsigned int i=0; i<n; ++i)
       mem += memory_consumption(v[i]);
@@ -527,7 +527,7 @@ namespace MemoryConsumption
   template <typename T, int N>
   std::size_t memory_consumption (const T (&v)[N])
   {
-    unsigned int mem = 0;
+    std::size_t mem = 0;
     for (unsigned int i=0; i<N; ++i)
       mem += memory_consumption(v[i]);
     return mem;

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.