[commit: ghc] master: Generalise the type of fieldSz and use it more (63f3bd8)

Ian Lynagh igloo at earth.li
Tue Apr 9 16:41:47 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/63f3bd8fe38cb377e31993ecee7362717b6894de

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

commit 63f3bd8fe38cb377e31993ecee7362717b6894de
Author: Ian Lynagh <ian at well-typed.com>
Date:   Mon Apr 8 16:12:08 2013 +0100

    Generalise the type of fieldSz and use it more

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

 compiler/ghci/ByteCodeItbls.lhs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/ghci/ByteCodeItbls.lhs b/compiler/ghci/ByteCodeItbls.lhs
index f152473..c79e08d 100644
--- a/compiler/ghci/ByteCodeItbls.lhs
+++ b/compiler/ghci/ByteCodeItbls.lhs
@@ -285,8 +285,8 @@ data StgConInfoTable = StgConInfoTable {
 
 sizeOfConItbl :: StgConInfoTable -> Int
 sizeOfConItbl conInfoTable
-      = sum [ sizeOf (conDesc conInfoTable)
-            , sizeOf (infoTable conInfoTable) ]
+      = sum [ fieldSz conDesc conInfoTable
+            , fieldSz infoTable conInfoTable ]
 
 pokeConItbl :: DynFlags -> Ptr StgConInfoTable -> Ptr StgConInfoTable -> StgConInfoTable
             -> IO ()
@@ -374,7 +374,7 @@ instance Storable StgInfoTable where
 #endif
               }
 
-fieldSz :: (Storable a, Storable b) => (a -> b) -> a -> Int
+fieldSz :: Storable b => (a -> b) -> a -> Int
 fieldSz sel x = sizeOf (sel x)
 
 newtype State s m a = State (s -> m (s, a))





More information about the ghc-commits mailing list