X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FRtClosureInspect.hs;h=269a7bb1d26347b6e04adb638ff902261221865a;hb=fe16e5d64edfa6f7200ab3ebf6c8d14571574302;hp=b5d67cf10b391e91ce209263d334567b3efad680;hpb=6c7b41cc2b24f533697a62bf1843507ae043fc97;p=ghc-hetmet.git diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index b5d67cf..269a7bb 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -67,10 +67,13 @@ import TysPrim import PrelNames import TysWiredIn -import Constants import Outputable import Panic +#ifndef GHCI_TABLES_NEXT_TO_CODE +import Constants ( wORD_SIZE ) +#endif + import GHC.Arr ( Array(..) ) import GHC.Exts import GHC.IOBase ( IO(IO) ) @@ -260,11 +263,11 @@ extractUnboxed tt clos = go tt (nonPtrs clos) | otherwise = pprPanic "Expected a TcTyCon" (ppr t) go [] _ = [] go (t:tt) xx - | (x, rest) <- splitAt ((sizeofType t + wORD_SIZE - 1) `div` wORD_SIZE) xx + | (x, rest) <- splitAt (sizeofType t) xx = x : go tt rest -sizeofTyCon :: TyCon -> Int -sizeofTyCon = sizeofPrimRep . tyConPrimRep +sizeofTyCon :: TyCon -> Int -- in *words* +sizeofTyCon = primRepSizeW . tyConPrimRep ----------------------------------- -- * Traversals for Terms