summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralexbiehl <alex.biehl@gmail.com>2017-02-11 19:22:26 -0500
committerBen Gamari <ben@smart-cactus.org>2017-02-11 19:58:34 -0500
commit64da671afb9fdb097ff355a9cca1c8ed098a9114 (patch)
treeee59a8b4d6cf306ac73fcafc1c8a1271181fa39d
parent07292e958cb0c08705d9a694f09d9621058b16e6 (diff)
downloadhaskell-64da671afb9fdb097ff355a9cca1c8ed098a9114.tar.gz
Binary: Only allocate un-interned FastStrings
Test Plan: Validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3109
-rw-r--r--compiler/utils/Binary.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs
index 275b1a9b0f..565d162be6 100644
--- a/compiler/utils/Binary.hs
+++ b/compiler/utils/Binary.hs
@@ -724,8 +724,9 @@ putFS :: BinHandle -> FastString -> IO ()
putFS bh fs = putBS bh $ fastStringToByteString fs
getFS :: BinHandle -> IO FastString
-getFS bh = do bs <- getBS bh
- return $! mkFastStringByteString bs
+getFS bh = do
+ l <- get bh :: IO Int
+ getPrim bh l (\src -> pure $! mkFastStringBytes src l )
putBS :: BinHandle -> ByteString -> IO ()
putBS bh bs =