[commit: packages/binary] master: Force the Fingerprint constructor to reduce memory usage. (66146ae)

git at git.haskell.org git at git.haskell.org
Wed Dec 16 09:42:20 UTC 2015


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

On branch  : master
Link       : http://git.haskell.org/packages/binary.git/commitdiff/66146ae3423fbbd62a24246f591cfba46ce3a0d4

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

commit 66146ae3423fbbd62a24246f591cfba46ce3a0d4
Author: Lennart Kolmodin <kolmodin at google.com>
Date:   Wed Jun 3 11:50:56 2015 -0700

    Force the Fingerprint constructor to reduce memory usage.
    
    The two fields are unpacked, so this saves a couple of words per field
    until the Fingerprint value gets used.


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

66146ae3423fbbd62a24246f591cfba46ce3a0d4
 src/Data/Binary/Class.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Data/Binary/Class.hs b/src/Data/Binary/Class.hs
index 8904381..79a30b2 100644
--- a/src/Data/Binary/Class.hs
+++ b/src/Data/Binary/Class.hs
@@ -599,5 +599,5 @@ instance Binary Fingerprint where
     get = do
         x1 <- get
         x2 <- get
-        return (Fingerprint x1 x2)
+        return $! Fingerprint x1 x2
 #endif



More information about the ghc-commits mailing list