diff --git a/include/engine/datafacade/mmap_memory_allocator.hpp b/include/engine/datafacade/mmap_memory_allocator.hpp index 60df71e90..fc4b4e24a 100644 --- a/include/engine/datafacade/mmap_memory_allocator.hpp +++ b/include/engine/datafacade/mmap_memory_allocator.hpp @@ -33,7 +33,7 @@ class MMapMemoryAllocator : public ContiguousBlockAllocator private: storage::SharedDataIndex index; - std::vector mapped_memory_files; + std::vector mapped_memory_files; std::string rtree_filename; }; diff --git a/src/engine/datafacade/mmap_memory_allocator.cpp b/src/engine/datafacade/mmap_memory_allocator.cpp index fd87cc42a..38038656c 100644 --- a/src/engine/datafacade/mmap_memory_allocator.cpp +++ b/src/engine/datafacade/mmap_memory_allocator.cpp @@ -52,11 +52,11 @@ MMapMemoryAllocator::MMapMemoryAllocator(const storage::StorageConfig &config) { std::unique_ptr layout = std::make_unique(); - boost::iostreams::mapped_file mapped_memory_file; - util::mmapFile(file.second, mapped_memory_file); + boost::iostreams::mapped_file_source mapped_memory_file; + auto data = util::mmapFile(file.second, mapped_memory_file).data(); mapped_memory_files.push_back(std::move(mapped_memory_file)); storage::populateLayoutFromFile(file.second, *layout); - allocated_regions.push_back({mapped_memory_file.data(), std::move(layout)}); + allocated_regions.push_back({const_cast(data), std::move(layout)}); } }