aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-08-08 13:51:53 -0400
committerErik Schnetter <schnetter@gmail.com>2013-08-08 13:51:53 -0400
commit6b415f376d2470aebb13e678d14e475e7c80a505 (patch)
tree75c66ccf6d14b324cf19d6630bac50939baae38b
parentf76e4b872473b41c30ef410c5931a4bbfdd73e0a (diff)
CarpetLib: Correct type error for nbytes in memory allocation
-rw-r--r--Carpet/CarpetLib/src/mem.cc4
1 files 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<T>::
#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;
}