From fd9070fdc28e2bf25960d02ff60f726bbef79cd0 Mon Sep 17 00:00:00 2001 From: canepat <16927169+canepat@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:39:11 +0100 Subject: [PATCH] infra, db: fix Clang Tidy and Win build after PR 1911 --- silkworm/db/snapshots/index.cpp | 4 ++-- silkworm/infra/common/memory_mapped_file.cpp | 4 ++-- silkworm/infra/common/memory_mapped_file.hpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/silkworm/db/snapshots/index.cpp b/silkworm/db/snapshots/index.cpp index 51aca40df5..ea5ba5b31a 100644 --- a/silkworm/db/snapshots/index.cpp +++ b/silkworm/db/snapshots/index.cpp @@ -280,10 +280,10 @@ void TransactionIndex::build() { SILK_TRACE << "TransactionIndex::build path: " << segment_path_.path().string() << " end"; } -bool TransactionIndex::walk(RecSplit8& rec_split, uint64_t i, uint64_t offset, ByteView tx_buffer) { +bool TransactionIndex::walk(RecSplit8& rec_split, uint64_t i, uint64_t offset, ByteView word) { Hash tx_hash; try { - tx_hash = tx_buffer_hash(tx_buffer, base_data_id_ + i); + tx_hash = tx_buffer_hash(word, base_data_id_ + i); } catch (const std::runtime_error& ex) { std::stringstream error; error << "TransactionIndex::build cannot build index for: " << segment_path_.path() diff --git a/silkworm/infra/common/memory_mapped_file.cpp b/silkworm/infra/common/memory_mapped_file.cpp index af476657ec..f08265cf9d 100644 --- a/silkworm/infra/common/memory_mapped_file.cpp +++ b/silkworm/infra/common/memory_mapped_file.cpp @@ -118,8 +118,8 @@ void* MemoryMappedFile::mmap(FileDescriptor fd, size_t size, bool read_only) { } void MemoryMappedFile::unmap() { - if (address_ != nullptr) { - ::UnmapViewOfFile(address_); + if (region_.data() != nullptr) { + ::UnmapViewOfFile(region_.data()); } } diff --git a/silkworm/infra/common/memory_mapped_file.hpp b/silkworm/infra/common/memory_mapped_file.hpp index d344f988e5..e580f1647c 100644 --- a/silkworm/infra/common/memory_mapped_file.hpp +++ b/silkworm/infra/common/memory_mapped_file.hpp @@ -114,7 +114,7 @@ class MemoryMappedFile { //! The path to the file std::filesystem::path path_; - //! The address of the mapped area + //! The area mapped in memory MemoryMappedRegion region_; //! Flag indicating if memory-mapping is managed internally or not