Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/guardedalloc')
-rw-r--r--intern/guardedalloc/intern/mmap_win.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/guardedalloc/intern/mmap_win.c b/intern/guardedalloc/intern/mmap_win.c
index 5b0c4b6614a..3508ae4e1aa 100644
--- a/intern/guardedalloc/intern/mmap_win.c
+++ b/intern/guardedalloc/intern/mmap_win.c
@@ -125,8 +125,11 @@ void *mmap(void *UNUSED(start), size_t len, int prot, int flags, int fd, off_t o
}
}
- /* note len is passed to a 32 bit DWORD, so can't be > 4 GB */
- maphandle = CreateFileMapping(fhandle, NULL, prot_flags, 0, len, NULL);
+ /* Split 64 bit size into low and high bits. */
+ DWORD len_bits_high = len >> 32;
+ DWORD len_bits_low = len & 0xFFFFFFFF;
+
+ maphandle = CreateFileMapping(fhandle, NULL, prot_flags, len_bits_high, len_bits_low, NULL);
if (maphandle == 0) {
errno = EBADF;
return MAP_FAILED;