[commit: ghc] master: Binary: Only allocate un-interned FastStrings (64da671)

git at git.haskell.org git at git.haskell.org
Sun Feb 12 01:09:01 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/64da671afb9fdb097ff355a9cca1c8ed098a9114/ghc

>---------------------------------------------------------------

commit 64da671afb9fdb097ff355a9cca1c8ed098a9114
Author: alexbiehl <alex.biehl at gmail.com>
Date:   Sat Feb 11 19:22:26 2017 -0500

    Binary: Only allocate un-interned FastStrings
    
    Test Plan: Validate
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D3109


>---------------------------------------------------------------

64da671afb9fdb097ff355a9cca1c8ed098a9114
 compiler/utils/Binary.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs
index 275b1a9..565d162 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 =



More information about the ghc-commits mailing list