From a214250f70d218c055ef7b82f45f987183dceecf Mon Sep 17 00:00:00 2001 From: pknowles Date: Thu, 16 Oct 2025 20:43:10 -0700 Subject: [PATCH] MAP_SHARED even for read-only MAP_PRIVATE is backed by swap, which limits the maximum size --- include/decodeless/detail/mappedfile_linux.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/decodeless/detail/mappedfile_linux.hpp b/include/decodeless/detail/mappedfile_linux.hpp index 87e8ea0..0a9cae4 100644 --- a/include/decodeless/detail/mappedfile_linux.hpp +++ b/include/decodeless/detail/mappedfile_linux.hpp @@ -196,7 +196,7 @@ class MappedFile { using data_type = std::conditional_t; MappedFile(const fs::path& path) : m_file(path, Writable ? O_RDWR : O_RDONLY) - , m_mapped(nullptr, m_file.size(), Writable ? MAP_SHARED : MAP_PRIVATE, m_file, 0) {} + , m_mapped(nullptr, m_file.size(), MAP_SHARED, m_file, 0) {} data_type data() const { return m_mapped.address(); } size_t size() const { return m_mapped.size(); }