forked from mirrors/nixpkgs
ghc801: disable MADV_FREE
This commit is contained in:
parent
571ee39714
commit
54125b4af4
|
@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
|
|||
# Fix https://ghc.haskell.org/trac/ghc/ticket/12130
|
||||
(fetchFilteredPatch { url = https://git.haskell.org/ghc.git/patch/4d71cc89b4e9648f3fbb29c8fcd25d725616e265; sha256 = "0syaxb4y4s2dc440qmrggb4vagvqqhb55m6mx12rip4i9qhxl8k0"; })
|
||||
(fetchFilteredPatch { url = https://git.haskell.org/ghc.git/patch/2f8cd14fe909a377b3e084a4f2ded83a0e6d44dd; sha256 = "06zvlgcf50ab58bw6yw3krn45dsmhg4cmlz4nqff8k4z1f1bj01v"; })
|
||||
];
|
||||
] ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch;
|
||||
|
||||
buildInputs = [ ghc perl hscolour ];
|
||||
|
||||
|
|
18
pkgs/development/compilers/ghc/ghc-no-madv-free.patch
Normal file
18
pkgs/development/compilers/ghc/ghc-no-madv-free.patch
Normal file
|
@ -0,0 +1,18 @@
|
|||
diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c
|
||||
index 99620ee..e052a84 100644
|
||||
--- a/rts/posix/OSMem.c
|
||||
+++ b/rts/posix/OSMem.c
|
||||
@@ -523,13 +523,7 @@ void osDecommitMemory(void *at, W_ size)
|
||||
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");
|
||||
}
|
Loading…
Reference in a new issue