MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / WriteBatch

Method WriteBatch

src/dbwrapper.cpp:183–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183bool CDBWrapper::WriteBatch(CDBBatch& batch, bool fSync)
184{
185 const bool log_memory = LogAcceptCategory(BCLog::LEVELDB);
186 double mem_before = 0;
187 if (log_memory) {
188 mem_before = DynamicMemoryUsage() / 1024.0 / 1024;
189 }
190 leveldb::Status status = pdb->Write(fSync ? syncoptions : writeoptions, &batch.batch);
191 dbwrapper_private::HandleError(status);
192 if (log_memory) {
193 double mem_after = DynamicMemoryUsage() / 1024.0 / 1024;
194 LogPrint(BCLog::LEVELDB, "WriteBatch memory usage: db=%s, before=%.1fMiB, after=%.1fMiB\n",
195 m_name, mem_before, mem_after);
196 }
197 return true;
198}
199
200size_t CDBWrapper::DynamicMemoryUsage() const {
201 std::string memory;

Callers 2

BatchWriteMethod · 0.45
UpgradeMethod · 0.45

Calls 3

LogAcceptCategoryFunction · 0.85
HandleErrorFunction · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected