diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/alloc_mmap/mmap_mem.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/alloc_mmap/mmap_mem.cpp b/modules/alloc_mmap/mmap_mem.cpp index 5955f9e22..e22c2dac5 100644 --- a/modules/alloc_mmap/mmap_mem.cpp +++ b/modules/alloc_mmap/mmap_mem.cpp @@ -87,7 +87,13 @@ void* MemoryMapping_Allocator::alloc_block(u32bit n) if(::write(file.get_fd(), "\0", 1) != 1) throw MemoryMapping_Failed("Could not write to file"); - void* ptr = ::mmap(0, n, PROT_READ | PROT_WRITE, MAP_SHARED, + int flags = MAP_SHARED; + +#ifdef MAP_NOSYNC + flags |= MAP_NOSYNC; +#endif + + void* ptr = ::mmap(0, n, PROT_READ | PROT_WRITE, flags, file.get_fd(), 0); if(ptr == static_cast<void*>(MAP_FAILED)) |