2016-09-28 14:42:24 +00:00
|
|
|
Index: ghc-8.0.1/rts/posix/OSMem.c
|
|
|
|
===================================================================
|
|
|
|
--- ghc-8.0.1.orig/rts/posix/OSMem.c
|
|
|
|
+++ ghc-8.0.1/rts/posix/OSMem.c
|
|
|
|
@@ -504,13 +504,7 @@ void osDecommitMemory(void *at, W_ size)
|
2016-09-28 10:48:25 +00:00
|
|
|
sysErrorBelch("unable to make released memory unaccessible");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef MADV_FREE
|
|
|
|
- // Try MADV_FREE first, FreeBSD has both and MADV_DONTNEED
|
|
|
|
- // just swaps memory out
|
|
|
|
- r = madvise(at, size, MADV_FREE);
|
|
|
|
-#else
|
|
|
|
r = madvise(at, size, MADV_DONTNEED);
|
|
|
|
-#endif
|
|
|
|
if(r < 0)
|
|
|
|
sysErrorBelch("unable to decommit memory");
|
|
|
|
}
|