From: Sebastian Proell Date: Fri, 3 May 2024 09:10:48 +0000 (+0200) Subject: Include allocated vectors in GrowingVectorMemory's memory consumption X-Git-Tag: v9.6.0-rc1~293^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16957%2Fhead;p=dealii.git Include allocated vectors in GrowingVectorMemory's memory consumption --- diff --git a/include/deal.II/lac/vector_memory.templates.h b/include/deal.II/lac/vector_memory.templates.h index 624868e4ba..c701df6fcc 100644 --- a/include/deal.II/lac/vector_memory.templates.h +++ b/include/deal.II/lac/vector_memory.templates.h @@ -204,9 +204,9 @@ GrowingVectorMemory::memory_consumption() const std::lock_guard lock(mutex); std::size_t result = sizeof(*this); - for (const entry_type &i : *get_pool().data) - result += - sizeof(entry_type) + MemoryConsumption::memory_consumption(i.second); + for (const auto &[_, ptr] : *get_pool().data) + result += sizeof(ptr) + (ptr ? MemoryConsumption::memory_consumption(*ptr) : + MemoryConsumption::memory_consumption(ptr)); return result; }