From 6b8d4cfe7bfb56231a043afd1f3c8e403b07bbb1 Mon Sep 17 00:00:00 2001 From: Sacha Date: Tue, 10 Dec 2013 23:23:47 +1000 Subject: [PATCH] Blackberry/BSDs: Don't sync memory back to the underlying file. This is terrible on I/O performance. Linux already has this by default. See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21820 --- Common/MemArena.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Common/MemArena.cpp b/Common/MemArena.cpp index f3de893db9..987adc3a1f 100644 --- a/Common/MemArena.cpp +++ b/Common/MemArena.cpp @@ -175,6 +175,12 @@ void *MemArena::CreateView(s64 offset, size_t size, void *base) return ptr; #else void *retval = mmap(base, size, PROT_READ | PROT_WRITE, MAP_SHARED | +// Do not sync memory to underlying file. Linux has this by default. +#ifdef BLACKBERRY + MAP_NOSYNCFILE | +#elif defined(__FreeBSD__) + MAP_NOSYNC | +#endif ((base == 0) ? 0 : MAP_FIXED), fd, offset); if (retval == MAP_FAILED)