Fix memory mapped data offset

I think the virtual address maybe like this: ctx.data = mapping_start + offset - aligned_offset;
This commit is contained in:
MambaWong 2019-05-19 13:29:27 +08:00 committed by GitHub
parent e101ff3e89
commit c071714a70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,7 +201,7 @@ inline mmap_context memory_map(const file_handle_type file_handle, const int64_t
} }
#endif #endif
mmap_context ctx; mmap_context ctx;
ctx.data = mapping_start + offset; ctx.data = mapping_start + offset - aligned_offset;
ctx.length = length; ctx.length = length;
ctx.mapped_length = length_to_map; ctx.mapped_length = length_to_map;
#ifdef _WIN32 #ifdef _WIN32