[commit: ghc] wip/rwbarton-biniface: Use half as much memory when reading interfaces (285be06)
git at git.haskell.org
git at git.haskell.org
Mon Feb 20 01:06:37 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/rwbarton-biniface
Link : http://ghc.haskell.org/trac/ghc/changeset/285be0626a28980e87c1c8afb628b0ca0f7d08f4/ghc
>---------------------------------------------------------------
commit 285be0626a28980e87c1c8afb628b0ca0f7d08f4
Author: Reid Barton <rwbarton at gmail.com>
Date: Sun Feb 19 20:05:06 2017 -0500
Use half as much memory when reading interfaces
>---------------------------------------------------------------
285be0626a28980e87c1c8afb628b0ca0f7d08f4
compiler/utils/Binary.hs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs
index 07eb3bc..4345654 100644
--- a/compiler/utils/Binary.hs
+++ b/compiler/utils/Binary.hs
@@ -197,7 +197,7 @@ readBinMem filename = do
h <- openBinaryFile filename ReadMode
filesize' <- hFileSize h
let filesize = fromIntegral filesize'
- arr <- mallocForeignPtrBytes (filesize*2)
+ arr <- mallocForeignPtrBytes filesize
count <- withForeignPtr arr $ \p -> hGetBuf h p filesize
when (count /= filesize) $
error ("Binary.readBinMem: only read " ++ show count ++ " bytes")
More information about the ghc-commits
mailing list