diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2018-03-26 10:11:44 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2018-03-27 22:39:19 +0200 |
commit | a16c6d23cadb517f1e728c719a316768ae7b7fe8 (patch) | |
tree | b40b87c42dbfdcca9bcacd901b4fcdd4df220bf5 /src | |
parent | 7466a26cab5d66665991433947964a638f5b957e (diff) |
Fix error in memory usage calculation (unintended integer division)
Diffstat (limited to 'src')
-rw-r--r-- | src/dbwrapper.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp index fb0d4215a2..4fad5d0c77 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -159,12 +159,12 @@ bool CDBWrapper::WriteBatch(CDBBatch& batch, bool fSync) const bool log_memory = LogAcceptCategory(BCLog::LEVELDB); double mem_before = 0; if (log_memory) { - mem_before = DynamicMemoryUsage() / 1024 / 1024; + mem_before = DynamicMemoryUsage() / 1024.0 / 1024; } leveldb::Status status = pdb->Write(fSync ? syncoptions : writeoptions, &batch.batch); dbwrapper_private::HandleError(status); if (log_memory) { - double mem_after = DynamicMemoryUsage() / 1024 / 1024; + double mem_after = DynamicMemoryUsage() / 1024.0 / 1024; LogPrint(BCLog::LEVELDB, "WriteBatch memory usage: db=%s, before=%.1fMiB, after=%.1fMiB\n", m_name, mem_before, mem_after); } |