diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-08-08 13:51:53 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-08-08 13:51:53 -0400 |
commit | 6b415f376d2470aebb13e678d14e475e7c80a505 (patch) | |
tree | 75c66ccf6d14b324cf19d6630bac50939baae38b /Carpet/CarpetLib/src/mem.cc | |
parent | f76e4b872473b41c30ef410c5931a4bbfdd73e0a (diff) |
CarpetLib: Correct type error for nbytes in memory allocation
Diffstat (limited to 'Carpet/CarpetLib/src/mem.cc')
-rw-r--r-- | Carpet/CarpetLib/src/mem.cc | 4 |
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; } |