diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-03-29 15:11:45 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-03-29 15:12:21 +0200 |
commit | e80716d3b32496b050f7273e4fe6dd984a5bb292 (patch) | |
tree | f618f419c88eaa0d2633ffb4b679a0d9a9563ad2 /src | |
parent | cd99e5bdc8fc72948dc6133a024b8b98481242fc (diff) | |
parent | a16c6d23cadb517f1e728c719a316768ae7b7fe8 (diff) |
Merge #12784: Fix bug in memory usage calculation (unintended integer division)
a16c6d2 Fix error in memory usage calculation (unintended integer division) (practicalswift)
Pull request description:
Fix bug in memory usage calculation (unintended integer division).
Tree-SHA512: 2df1f00c5282581c61e1fd55fef3fabc02161b5a47d8f1795b05d57117245ff3d1ee861dd689eebe0185f28176cea428007e799d5c43a1ce5dc704123439f967
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 fef8eedd14..752f985bc0 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -184,12 +184,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); } |