From 6b415f376d2470aebb13e678d14e475e7c80a505 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 8 Aug 2013 13:51:53 -0400 Subject: CarpetLib: Correct type error for nbytes in memory allocation --- Carpet/CarpetLib/src/mem.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Carpet/CarpetLib/src/mem.cc b/Carpet/CarpetLib/src/mem.cc index 1a529e08a..113bdb53a 100644 --- a/Carpet/CarpetLib/src/mem.cc +++ b/Carpet/CarpetLib/src/mem.cc @@ -103,7 +103,7 @@ mem (size_t const vectorlength, size_t const nelems, // Safety check assert(alignment <= 1024); - const double nbytes = (vectorlength * nelems + final_padding) * sizeof (T); + const size_t nbytes = (vectorlength * nelems + final_padding) * sizeof (T); if (max_allowed_memory_MB > 0 and (total_allocated_bytes + nbytes > MEGA * max_allowed_memory_MB)) { @@ -168,7 +168,7 @@ mem:: #endif size_t const final_padding = vector_size - 1; - const double nbytes = + const size_t nbytes = (vectorlength_ * nelems_ + final_padding) * sizeof (T); total_allocated_bytes -= nbytes; } -- cgit v1.2.3