From c071714a7066858a54c925d031d356ebd49e0db0 Mon Sep 17 00:00:00 2001 From: MambaWong Date: Sun, 19 May 2019 13:29:27 +0800 Subject: [PATCH] Fix memory mapped data offset I think the virtual address maybe like this: ctx.data = mapping_start + offset - aligned_offset; --- include/mio/detail/mmap.ipp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mio/detail/mmap.ipp b/include/mio/detail/mmap.ipp index 2e73958..361db30 100644 --- a/include/mio/detail/mmap.ipp +++ b/include/mio/detail/mmap.ipp @@ -201,7 +201,7 @@ inline mmap_context memory_map(const file_handle_type file_handle, const int64_t } #endif mmap_context ctx; - ctx.data = mapping_start + offset; + ctx.data = mapping_start + offset - aligned_offset; ctx.length = length; ctx.mapped_length = length_to_map; #ifdef _WIN32